From de6fb1b4669ae640fb9e024388c739aba41073dc Mon Sep 17 00:00:00 2001 From: Peterino2 Date: Fri, 13 Nov 2026 02:56:42 +0000 Subject: [PATCH 1/2] Regenerate bindings for Zig 0.17 with fixed generator Regenerates every existing release directory with the Zig 0.17 port of sdlparser-scrap, including its codegen fixes: - enums: all enumerators are present and numbered as in C (previously members written as `NAME = value,` without a comment were dropped, e.g. most of Scancode and PixelFormat); duplicate values are aliases - flags: packed struct fields sit on the bit the header assigns (flags after a gap, such as SDL_WINDOW_VULKAN, were on the wrong bit) - structs: fields followed by a multi-line comment are no longer dropped (VirtualJoystickDesc, HapticPeriodic had wrong layouts) - wrappers: casts follow how each type is declared, so the inline functions type-check against the translated C API - uses @backingInt/@fromBackingInt and callconv(.c) - new modules: guid, pen, iostream, keyboard, scancode, power, process, opengl, tray plus the c.zig/stdinc.zig bridge files - castholm v0.1.0 (SDL 3.1.6) now generates; stale debug output removed Verified per release on Linux against that release's headers: wrapper bodies compile, struct layouts and field offsets, enum values and flag bits match C. Only Windows/GDK-only symbols are unavailable there. --- README.md | 13 + castholm/v0.1.0-SDL-3.1.6/api/audio.zig | 117 +- castholm/v0.1.0-SDL-3.1.6/api/blendmode.zig | 7 +- castholm/v0.1.0-SDL-3.1.6/api/c.zig | 1 + castholm/v0.1.0-SDL-3.1.6/api/camera.zig | 80 +- castholm/v0.1.0-SDL-3.1.6/api/clipboard.zig | 9 +- castholm/v0.1.0-SDL-3.1.6/api/dialog.zig | 9 +- castholm/v0.1.0-SDL-3.1.6/api/error.zig | 4 + castholm/v0.1.0-SDL-3.1.6/api/events.zig | 231 +-- castholm/v0.1.0-SDL-3.1.6/api/filesystem.zig | 17 +- castholm/v0.1.0-SDL-3.1.6/api/gamepad.zig | 187 ++- castholm/v0.1.0-SDL-3.1.6/api/gpu.zig | 233 ++- castholm/v0.1.0-SDL-3.1.6/api/guid.zig | 13 + castholm/v0.1.0-SDL-3.1.6/api/haptic.zig | 79 +- castholm/v0.1.0-SDL-3.1.6/api/hints.zig | 3 +- castholm/v0.1.0-SDL-3.1.6/api/init.zig | 6 +- castholm/v0.1.0-SDL-3.1.6/api/iostream.zig | 213 +++ castholm/v0.1.0-SDL-3.1.6/api/joystick.zig | 154 +- castholm/v0.1.0-SDL-3.1.6/api/keyboard.zig | 131 ++ castholm/v0.1.0-SDL-3.1.6/api/keycode.zig | 1 - castholm/v0.1.0-SDL-3.1.6/api/loadso.zig | 9 +- castholm/v0.1.0-SDL-3.1.6/api/messagebox.zig | 16 +- castholm/v0.1.0-SDL-3.1.6/api/misc.zig | 1 - castholm/v0.1.0-SDL-3.1.6/api/mouse.zig | 69 +- castholm/v0.1.0-SDL-3.1.6/api/opengl.zig | 2 + castholm/v0.1.0-SDL-3.1.6/api/pen.zig | 33 + castholm/v0.1.0-SDL-3.1.6/api/pixels.zig | 132 +- castholm/v0.1.0-SDL-3.1.6/api/power.zig | 14 + castholm/v0.1.0-SDL-3.1.6/api/process.zig | 52 + castholm/v0.1.0-SDL-3.1.6/api/properties.zig | 3 +- castholm/v0.1.0-SDL-3.1.6/api/rect.zig | 25 +- castholm/v0.1.0-SDL-3.1.6/api/render.zig | 1073 +++----------- castholm/v0.1.0-SDL-3.1.6/api/scancode.zig | 253 ++++ castholm/v0.1.0-SDL-3.1.6/api/sensor.zig | 29 +- castholm/v0.1.0-SDL-3.1.6/api/stdinc.zig | 3 + castholm/v0.1.0-SDL-3.1.6/api/storage.zig | 97 +- castholm/v0.1.0-SDL-3.1.6/api/surface.zig | 207 +-- castholm/v0.1.0-SDL-3.1.6/api/system.zig | 29 +- castholm/v0.1.0-SDL-3.1.6/api/time.zig | 15 +- castholm/v0.1.0-SDL-3.1.6/api/timer.zig | 1 - castholm/v0.1.0-SDL-3.1.6/api/touch.zig | 15 +- castholm/v0.1.0-SDL-3.1.6/api/version.zig | 1 - castholm/v0.1.0-SDL-3.1.6/api/video.zig | 253 ++-- .../debug/error_SDL_touch_h.zig | 36 - castholm/v0.1.0-SDL-3.1.6/json/audio.json | 12 + castholm/v0.1.0-SDL-3.1.6/json/blendmode.json | 6 +- castholm/v0.1.0-SDL-3.1.6/json/events.json | 64 +- .../v0.1.0-SDL-3.1.6/json/filesystem.json | 9 +- castholm/v0.1.0-SDL-3.1.6/json/gamepad.json | 16 + castholm/v0.1.0-SDL-3.1.6/json/gpu.json | 6 +- castholm/v0.1.0-SDL-3.1.6/json/guid.json | 51 + castholm/v0.1.0-SDL-3.1.6/json/haptic.json | 8 + castholm/v0.1.0-SDL-3.1.6/json/iostream.json | 697 +++++++++ castholm/v0.1.0-SDL-3.1.6/json/joystick.json | 12 + castholm/v0.1.0-SDL-3.1.6/json/keyboard.json | 332 +++++ castholm/v0.1.0-SDL-3.1.6/json/opengl.json | 12 + castholm/v0.1.0-SDL-3.1.6/json/pen.json | 97 ++ castholm/v0.1.0-SDL-3.1.6/json/pixels.json | 383 ++++- castholm/v0.1.0-SDL-3.1.6/json/power.json | 58 + castholm/v0.1.0-SDL-3.1.6/json/process.json | 153 ++ castholm/v0.1.0-SDL-3.1.6/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.0-SDL-3.1.6/json/system.json | 4 + castholm/v0.1.0-SDL-3.1.6/json/touch.json | 6 +- castholm/v0.1.0-SDL-3.1.6/json/video.json | 3 +- castholm/v0.1.1-SDL-3.1.8/api/audio.zig | 121 +- castholm/v0.1.1-SDL-3.1.8/api/blendmode.zig | 7 +- castholm/v0.1.1-SDL-3.1.8/api/c.zig | 1 + castholm/v0.1.1-SDL-3.1.8/api/camera.zig | 80 +- castholm/v0.1.1-SDL-3.1.8/api/clipboard.zig | 9 +- castholm/v0.1.1-SDL-3.1.8/api/dialog.zig | 15 +- castholm/v0.1.1-SDL-3.1.8/api/error.zig | 4 + castholm/v0.1.1-SDL-3.1.8/api/events.zig | 231 +-- castholm/v0.1.1-SDL-3.1.8/api/filesystem.zig | 17 +- castholm/v0.1.1-SDL-3.1.8/api/gamepad.zig | 187 ++- castholm/v0.1.1-SDL-3.1.8/api/gpu.zig | 241 ++-- castholm/v0.1.1-SDL-3.1.8/api/guid.zig | 13 + castholm/v0.1.1-SDL-3.1.8/api/haptic.zig | 79 +- castholm/v0.1.1-SDL-3.1.8/api/hints.zig | 3 +- castholm/v0.1.1-SDL-3.1.8/api/init.zig | 6 +- castholm/v0.1.1-SDL-3.1.8/api/iostream.zig | 221 +++ castholm/v0.1.1-SDL-3.1.8/api/joystick.zig | 154 +- castholm/v0.1.1-SDL-3.1.8/api/keyboard.zig | 131 ++ castholm/v0.1.1-SDL-3.1.8/api/keycode.zig | 1 - castholm/v0.1.1-SDL-3.1.8/api/loadso.zig | 9 +- castholm/v0.1.1-SDL-3.1.8/api/messagebox.zig | 16 +- castholm/v0.1.1-SDL-3.1.8/api/misc.zig | 1 - castholm/v0.1.1-SDL-3.1.8/api/mouse.zig | 69 +- castholm/v0.1.1-SDL-3.1.8/api/opengl.zig | 2 + castholm/v0.1.1-SDL-3.1.8/api/pen.zig | 33 + castholm/v0.1.1-SDL-3.1.8/api/pixels.zig | 132 +- castholm/v0.1.1-SDL-3.1.8/api/power.zig | 14 + castholm/v0.1.1-SDL-3.1.8/api/process.zig | 52 + castholm/v0.1.1-SDL-3.1.8/api/properties.zig | 3 +- castholm/v0.1.1-SDL-3.1.8/api/rect.zig | 25 +- castholm/v0.1.1-SDL-3.1.8/api/render.zig | 1087 +++----------- castholm/v0.1.1-SDL-3.1.8/api/scancode.zig | 253 ++++ castholm/v0.1.1-SDL-3.1.8/api/sensor.zig | 29 +- castholm/v0.1.1-SDL-3.1.8/api/stdinc.zig | 3 + castholm/v0.1.1-SDL-3.1.8/api/storage.zig | 97 +- castholm/v0.1.1-SDL-3.1.8/api/surface.zig | 207 +-- castholm/v0.1.1-SDL-3.1.8/api/system.zig | 29 +- castholm/v0.1.1-SDL-3.1.8/api/time.zig | 15 +- castholm/v0.1.1-SDL-3.1.8/api/timer.zig | 1 - castholm/v0.1.1-SDL-3.1.8/api/touch.zig | 12 +- castholm/v0.1.1-SDL-3.1.8/api/tray.zig | 108 ++ castholm/v0.1.1-SDL-3.1.8/api/version.zig | 1 - castholm/v0.1.1-SDL-3.1.8/api/video.zig | 253 ++-- castholm/v0.1.1-SDL-3.1.8/json/audio.json | 12 + castholm/v0.1.1-SDL-3.1.8/json/blendmode.json | 6 +- castholm/v0.1.1-SDL-3.1.8/json/events.json | 64 +- .../v0.1.1-SDL-3.1.8/json/filesystem.json | 9 +- castholm/v0.1.1-SDL-3.1.8/json/gamepad.json | 16 + castholm/v0.1.1-SDL-3.1.8/json/gpu.json | 6 +- castholm/v0.1.1-SDL-3.1.8/json/guid.json | 51 + castholm/v0.1.1-SDL-3.1.8/json/haptic.json | 8 + castholm/v0.1.1-SDL-3.1.8/json/iostream.json | 737 ++++++++++ castholm/v0.1.1-SDL-3.1.8/json/joystick.json | 12 + castholm/v0.1.1-SDL-3.1.8/json/keyboard.json | 332 +++++ castholm/v0.1.1-SDL-3.1.8/json/opengl.json | 12 + castholm/v0.1.1-SDL-3.1.8/json/pen.json | 97 ++ castholm/v0.1.1-SDL-3.1.8/json/pixels.json | 383 ++++- castholm/v0.1.1-SDL-3.1.8/json/power.json | 58 + castholm/v0.1.1-SDL-3.1.8/json/process.json | 153 ++ castholm/v0.1.1-SDL-3.1.8/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.1-SDL-3.1.8/json/system.json | 4 + castholm/v0.1.1-SDL-3.1.8/json/touch.json | 4 + castholm/v0.1.1-SDL-3.1.8/json/tray.json | 317 +++++ castholm/v0.1.1-SDL-3.1.8/json/video.json | 3 +- castholm/v0.1.2-SDL-3.1.10/api/audio.zig | 123 +- castholm/v0.1.2-SDL-3.1.10/api/blendmode.zig | 7 +- castholm/v0.1.2-SDL-3.1.10/api/c.zig | 1 + castholm/v0.1.2-SDL-3.1.10/api/camera.zig | 80 +- castholm/v0.1.2-SDL-3.1.10/api/clipboard.zig | 9 +- castholm/v0.1.2-SDL-3.1.10/api/dialog.zig | 15 +- castholm/v0.1.2-SDL-3.1.10/api/error.zig | 4 + castholm/v0.1.2-SDL-3.1.10/api/events.zig | 226 +-- castholm/v0.1.2-SDL-3.1.10/api/filesystem.zig | 17 +- castholm/v0.1.2-SDL-3.1.10/api/gamepad.zig | 187 ++- castholm/v0.1.2-SDL-3.1.10/api/gpu.zig | 241 ++-- castholm/v0.1.2-SDL-3.1.10/api/guid.zig | 13 + castholm/v0.1.2-SDL-3.1.10/api/haptic.zig | 79 +- castholm/v0.1.2-SDL-3.1.10/api/hints.zig | 3 +- castholm/v0.1.2-SDL-3.1.10/api/init.zig | 6 +- castholm/v0.1.2-SDL-3.1.10/api/iostream.zig | 221 +++ castholm/v0.1.2-SDL-3.1.10/api/joystick.zig | 154 +- castholm/v0.1.2-SDL-3.1.10/api/keyboard.zig | 131 ++ castholm/v0.1.2-SDL-3.1.10/api/keycode.zig | 1 - castholm/v0.1.2-SDL-3.1.10/api/loadso.zig | 9 +- castholm/v0.1.2-SDL-3.1.10/api/messagebox.zig | 16 +- castholm/v0.1.2-SDL-3.1.10/api/misc.zig | 1 - castholm/v0.1.2-SDL-3.1.10/api/mouse.zig | 69 +- castholm/v0.1.2-SDL-3.1.10/api/opengl.zig | 2 + castholm/v0.1.2-SDL-3.1.10/api/pen.zig | 28 + castholm/v0.1.2-SDL-3.1.10/api/pixels.zig | 132 +- castholm/v0.1.2-SDL-3.1.10/api/power.zig | 14 + castholm/v0.1.2-SDL-3.1.10/api/process.zig | 52 + castholm/v0.1.2-SDL-3.1.10/api/properties.zig | 3 +- castholm/v0.1.2-SDL-3.1.10/api/rect.zig | 25 +- castholm/v0.1.2-SDL-3.1.10/api/render.zig | 1082 +++----------- castholm/v0.1.2-SDL-3.1.10/api/scancode.zig | 253 ++++ castholm/v0.1.2-SDL-3.1.10/api/sensor.zig | 29 +- castholm/v0.1.2-SDL-3.1.10/api/stdinc.zig | 3 + castholm/v0.1.2-SDL-3.1.10/api/storage.zig | 97 +- castholm/v0.1.2-SDL-3.1.10/api/surface.zig | 207 +-- castholm/v0.1.2-SDL-3.1.10/api/system.zig | 29 +- castholm/v0.1.2-SDL-3.1.10/api/time.zig | 15 +- castholm/v0.1.2-SDL-3.1.10/api/timer.zig | 1 - castholm/v0.1.2-SDL-3.1.10/api/touch.zig | 12 +- castholm/v0.1.2-SDL-3.1.10/api/tray.zig | 112 ++ castholm/v0.1.2-SDL-3.1.10/api/version.zig | 1 - castholm/v0.1.2-SDL-3.1.10/api/video.zig | 253 ++-- castholm/v0.1.2-SDL-3.1.10/json/audio.json | 12 + .../v0.1.2-SDL-3.1.10/json/blendmode.json | 6 +- castholm/v0.1.2-SDL-3.1.10/json/events.json | 64 +- .../v0.1.2-SDL-3.1.10/json/filesystem.json | 9 +- castholm/v0.1.2-SDL-3.1.10/json/gamepad.json | 16 + castholm/v0.1.2-SDL-3.1.10/json/gpu.json | 6 +- castholm/v0.1.2-SDL-3.1.10/json/guid.json | 51 + castholm/v0.1.2-SDL-3.1.10/json/haptic.json | 8 + castholm/v0.1.2-SDL-3.1.10/json/iostream.json | 737 ++++++++++ castholm/v0.1.2-SDL-3.1.10/json/joystick.json | 12 + castholm/v0.1.2-SDL-3.1.10/json/keyboard.json | 332 +++++ castholm/v0.1.2-SDL-3.1.10/json/opengl.json | 12 + castholm/v0.1.2-SDL-3.1.10/json/pen.json | 97 ++ castholm/v0.1.2-SDL-3.1.10/json/pixels.json | 383 ++++- castholm/v0.1.2-SDL-3.1.10/json/power.json | 58 + castholm/v0.1.2-SDL-3.1.10/json/process.json | 153 ++ castholm/v0.1.2-SDL-3.1.10/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.2-SDL-3.1.10/json/system.json | 4 + castholm/v0.1.2-SDL-3.1.10/json/touch.json | 4 + castholm/v0.1.2-SDL-3.1.10/json/tray.json | 327 +++++ castholm/v0.1.2-SDL-3.1.10/json/video.json | 3 +- castholm/v0.1.3-SDL-3.2.0/api/audio.zig | 123 +- castholm/v0.1.3-SDL-3.2.0/api/blendmode.zig | 7 +- castholm/v0.1.3-SDL-3.2.0/api/c.zig | 1 + castholm/v0.1.3-SDL-3.2.0/api/camera.zig | 80 +- castholm/v0.1.3-SDL-3.2.0/api/clipboard.zig | 9 +- castholm/v0.1.3-SDL-3.2.0/api/dialog.zig | 15 +- castholm/v0.1.3-SDL-3.2.0/api/error.zig | 4 + castholm/v0.1.3-SDL-3.2.0/api/events.zig | 226 +-- castholm/v0.1.3-SDL-3.2.0/api/filesystem.zig | 17 +- castholm/v0.1.3-SDL-3.2.0/api/gamepad.zig | 187 ++- castholm/v0.1.3-SDL-3.2.0/api/gpu.zig | 241 ++-- castholm/v0.1.3-SDL-3.2.0/api/guid.zig | 13 + castholm/v0.1.3-SDL-3.2.0/api/haptic.zig | 79 +- castholm/v0.1.3-SDL-3.2.0/api/hints.zig | 3 +- castholm/v0.1.3-SDL-3.2.0/api/init.zig | 6 +- castholm/v0.1.3-SDL-3.2.0/api/iostream.zig | 221 +++ castholm/v0.1.3-SDL-3.2.0/api/joystick.zig | 154 +- castholm/v0.1.3-SDL-3.2.0/api/keyboard.zig | 131 ++ castholm/v0.1.3-SDL-3.2.0/api/keycode.zig | 1 - castholm/v0.1.3-SDL-3.2.0/api/loadso.zig | 9 +- castholm/v0.1.3-SDL-3.2.0/api/messagebox.zig | 16 +- castholm/v0.1.3-SDL-3.2.0/api/misc.zig | 1 - castholm/v0.1.3-SDL-3.2.0/api/mouse.zig | 69 +- castholm/v0.1.3-SDL-3.2.0/api/opengl.zig | 2 + castholm/v0.1.3-SDL-3.2.0/api/pen.zig | 28 + castholm/v0.1.3-SDL-3.2.0/api/pixels.zig | 132 +- castholm/v0.1.3-SDL-3.2.0/api/power.zig | 14 + castholm/v0.1.3-SDL-3.2.0/api/process.zig | 52 + castholm/v0.1.3-SDL-3.2.0/api/properties.zig | 3 +- castholm/v0.1.3-SDL-3.2.0/api/rect.zig | 25 +- castholm/v0.1.3-SDL-3.2.0/api/render.zig | 1082 +++----------- castholm/v0.1.3-SDL-3.2.0/api/scancode.zig | 253 ++++ castholm/v0.1.3-SDL-3.2.0/api/sensor.zig | 29 +- castholm/v0.1.3-SDL-3.2.0/api/stdinc.zig | 3 + castholm/v0.1.3-SDL-3.2.0/api/storage.zig | 97 +- castholm/v0.1.3-SDL-3.2.0/api/surface.zig | 207 +-- castholm/v0.1.3-SDL-3.2.0/api/system.zig | 29 +- castholm/v0.1.3-SDL-3.2.0/api/time.zig | 15 +- castholm/v0.1.3-SDL-3.2.0/api/timer.zig | 1 - castholm/v0.1.3-SDL-3.2.0/api/touch.zig | 12 +- castholm/v0.1.3-SDL-3.2.0/api/tray.zig | 116 ++ castholm/v0.1.3-SDL-3.2.0/api/version.zig | 1 - castholm/v0.1.3-SDL-3.2.0/api/video.zig | 253 ++-- castholm/v0.1.3-SDL-3.2.0/json/audio.json | 12 + castholm/v0.1.3-SDL-3.2.0/json/blendmode.json | 6 +- castholm/v0.1.3-SDL-3.2.0/json/events.json | 64 +- .../v0.1.3-SDL-3.2.0/json/filesystem.json | 9 +- castholm/v0.1.3-SDL-3.2.0/json/gamepad.json | 16 + castholm/v0.1.3-SDL-3.2.0/json/gpu.json | 6 +- castholm/v0.1.3-SDL-3.2.0/json/guid.json | 51 + castholm/v0.1.3-SDL-3.2.0/json/haptic.json | 8 + castholm/v0.1.3-SDL-3.2.0/json/iostream.json | 737 ++++++++++ castholm/v0.1.3-SDL-3.2.0/json/joystick.json | 12 + castholm/v0.1.3-SDL-3.2.0/json/keyboard.json | 332 +++++ castholm/v0.1.3-SDL-3.2.0/json/opengl.json | 12 + castholm/v0.1.3-SDL-3.2.0/json/pen.json | 97 ++ castholm/v0.1.3-SDL-3.2.0/json/pixels.json | 383 ++++- castholm/v0.1.3-SDL-3.2.0/json/power.json | 58 + castholm/v0.1.3-SDL-3.2.0/json/process.json | 153 ++ castholm/v0.1.3-SDL-3.2.0/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.3-SDL-3.2.0/json/system.json | 4 + castholm/v0.1.3-SDL-3.2.0/json/touch.json | 4 + castholm/v0.1.3-SDL-3.2.0/json/tray.json | 332 +++++ castholm/v0.1.3-SDL-3.2.0/json/video.json | 3 +- castholm/v0.1.4-SDL-3.2.2/api/audio.zig | 123 +- castholm/v0.1.4-SDL-3.2.2/api/blendmode.zig | 7 +- castholm/v0.1.4-SDL-3.2.2/api/c.zig | 1 + castholm/v0.1.4-SDL-3.2.2/api/camera.zig | 80 +- castholm/v0.1.4-SDL-3.2.2/api/clipboard.zig | 9 +- castholm/v0.1.4-SDL-3.2.2/api/dialog.zig | 15 +- castholm/v0.1.4-SDL-3.2.2/api/error.zig | 4 + castholm/v0.1.4-SDL-3.2.2/api/events.zig | 226 +-- castholm/v0.1.4-SDL-3.2.2/api/filesystem.zig | 17 +- castholm/v0.1.4-SDL-3.2.2/api/gamepad.zig | 187 ++- castholm/v0.1.4-SDL-3.2.2/api/gpu.zig | 241 ++-- castholm/v0.1.4-SDL-3.2.2/api/guid.zig | 13 + castholm/v0.1.4-SDL-3.2.2/api/haptic.zig | 79 +- castholm/v0.1.4-SDL-3.2.2/api/hints.zig | 3 +- castholm/v0.1.4-SDL-3.2.2/api/init.zig | 6 +- castholm/v0.1.4-SDL-3.2.2/api/iostream.zig | 221 +++ castholm/v0.1.4-SDL-3.2.2/api/joystick.zig | 154 +- castholm/v0.1.4-SDL-3.2.2/api/keyboard.zig | 131 ++ castholm/v0.1.4-SDL-3.2.2/api/keycode.zig | 1 - castholm/v0.1.4-SDL-3.2.2/api/loadso.zig | 9 +- castholm/v0.1.4-SDL-3.2.2/api/messagebox.zig | 16 +- castholm/v0.1.4-SDL-3.2.2/api/misc.zig | 1 - castholm/v0.1.4-SDL-3.2.2/api/mouse.zig | 69 +- castholm/v0.1.4-SDL-3.2.2/api/opengl.zig | 2 + castholm/v0.1.4-SDL-3.2.2/api/pen.zig | 28 + castholm/v0.1.4-SDL-3.2.2/api/pixels.zig | 132 +- castholm/v0.1.4-SDL-3.2.2/api/power.zig | 14 + castholm/v0.1.4-SDL-3.2.2/api/process.zig | 52 + castholm/v0.1.4-SDL-3.2.2/api/properties.zig | 3 +- castholm/v0.1.4-SDL-3.2.2/api/rect.zig | 25 +- castholm/v0.1.4-SDL-3.2.2/api/render.zig | 1082 +++----------- castholm/v0.1.4-SDL-3.2.2/api/scancode.zig | 253 ++++ castholm/v0.1.4-SDL-3.2.2/api/sensor.zig | 29 +- castholm/v0.1.4-SDL-3.2.2/api/stdinc.zig | 3 + castholm/v0.1.4-SDL-3.2.2/api/storage.zig | 97 +- castholm/v0.1.4-SDL-3.2.2/api/surface.zig | 207 +-- castholm/v0.1.4-SDL-3.2.2/api/system.zig | 29 +- castholm/v0.1.4-SDL-3.2.2/api/time.zig | 15 +- castholm/v0.1.4-SDL-3.2.2/api/timer.zig | 1 - castholm/v0.1.4-SDL-3.2.2/api/touch.zig | 12 +- castholm/v0.1.4-SDL-3.2.2/api/tray.zig | 116 ++ castholm/v0.1.4-SDL-3.2.2/api/version.zig | 1 - castholm/v0.1.4-SDL-3.2.2/api/video.zig | 253 ++-- castholm/v0.1.4-SDL-3.2.2/json/audio.json | 12 + castholm/v0.1.4-SDL-3.2.2/json/blendmode.json | 6 +- castholm/v0.1.4-SDL-3.2.2/json/events.json | 64 +- .../v0.1.4-SDL-3.2.2/json/filesystem.json | 9 +- castholm/v0.1.4-SDL-3.2.2/json/gamepad.json | 16 + castholm/v0.1.4-SDL-3.2.2/json/gpu.json | 6 +- castholm/v0.1.4-SDL-3.2.2/json/guid.json | 51 + castholm/v0.1.4-SDL-3.2.2/json/haptic.json | 8 + castholm/v0.1.4-SDL-3.2.2/json/iostream.json | 737 ++++++++++ castholm/v0.1.4-SDL-3.2.2/json/joystick.json | 12 + castholm/v0.1.4-SDL-3.2.2/json/keyboard.json | 332 +++++ castholm/v0.1.4-SDL-3.2.2/json/opengl.json | 12 + castholm/v0.1.4-SDL-3.2.2/json/pen.json | 97 ++ castholm/v0.1.4-SDL-3.2.2/json/pixels.json | 383 ++++- castholm/v0.1.4-SDL-3.2.2/json/power.json | 58 + castholm/v0.1.4-SDL-3.2.2/json/process.json | 153 ++ castholm/v0.1.4-SDL-3.2.2/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.4-SDL-3.2.2/json/system.json | 4 + castholm/v0.1.4-SDL-3.2.2/json/touch.json | 4 + castholm/v0.1.4-SDL-3.2.2/json/tray.json | 332 +++++ castholm/v0.1.4-SDL-3.2.2/json/video.json | 3 +- castholm/v0.1.5-SDL-3.2.4/api/audio.zig | 123 +- castholm/v0.1.5-SDL-3.2.4/api/blendmode.zig | 7 +- castholm/v0.1.5-SDL-3.2.4/api/c.zig | 1 + castholm/v0.1.5-SDL-3.2.4/api/camera.zig | 80 +- castholm/v0.1.5-SDL-3.2.4/api/clipboard.zig | 9 +- castholm/v0.1.5-SDL-3.2.4/api/dialog.zig | 15 +- castholm/v0.1.5-SDL-3.2.4/api/error.zig | 4 + castholm/v0.1.5-SDL-3.2.4/api/events.zig | 226 +-- castholm/v0.1.5-SDL-3.2.4/api/filesystem.zig | 17 +- castholm/v0.1.5-SDL-3.2.4/api/gamepad.zig | 187 ++- castholm/v0.1.5-SDL-3.2.4/api/gpu.zig | 241 ++-- castholm/v0.1.5-SDL-3.2.4/api/guid.zig | 13 + castholm/v0.1.5-SDL-3.2.4/api/haptic.zig | 79 +- castholm/v0.1.5-SDL-3.2.4/api/hints.zig | 3 +- castholm/v0.1.5-SDL-3.2.4/api/init.zig | 6 +- castholm/v0.1.5-SDL-3.2.4/api/iostream.zig | 221 +++ castholm/v0.1.5-SDL-3.2.4/api/joystick.zig | 154 +- castholm/v0.1.5-SDL-3.2.4/api/keyboard.zig | 131 ++ castholm/v0.1.5-SDL-3.2.4/api/keycode.zig | 1 - castholm/v0.1.5-SDL-3.2.4/api/loadso.zig | 9 +- castholm/v0.1.5-SDL-3.2.4/api/messagebox.zig | 16 +- castholm/v0.1.5-SDL-3.2.4/api/misc.zig | 1 - castholm/v0.1.5-SDL-3.2.4/api/mouse.zig | 69 +- castholm/v0.1.5-SDL-3.2.4/api/opengl.zig | 2 + castholm/v0.1.5-SDL-3.2.4/api/pen.zig | 28 + castholm/v0.1.5-SDL-3.2.4/api/pixels.zig | 132 +- castholm/v0.1.5-SDL-3.2.4/api/power.zig | 14 + castholm/v0.1.5-SDL-3.2.4/api/process.zig | 52 + castholm/v0.1.5-SDL-3.2.4/api/properties.zig | 3 +- castholm/v0.1.5-SDL-3.2.4/api/rect.zig | 25 +- castholm/v0.1.5-SDL-3.2.4/api/render.zig | 1082 +++----------- castholm/v0.1.5-SDL-3.2.4/api/scancode.zig | 253 ++++ castholm/v0.1.5-SDL-3.2.4/api/sensor.zig | 29 +- castholm/v0.1.5-SDL-3.2.4/api/stdinc.zig | 3 + castholm/v0.1.5-SDL-3.2.4/api/storage.zig | 97 +- castholm/v0.1.5-SDL-3.2.4/api/surface.zig | 209 +-- castholm/v0.1.5-SDL-3.2.4/api/system.zig | 29 +- castholm/v0.1.5-SDL-3.2.4/api/time.zig | 15 +- castholm/v0.1.5-SDL-3.2.4/api/timer.zig | 1 - castholm/v0.1.5-SDL-3.2.4/api/touch.zig | 12 +- castholm/v0.1.5-SDL-3.2.4/api/tray.zig | 116 ++ castholm/v0.1.5-SDL-3.2.4/api/version.zig | 1 - castholm/v0.1.5-SDL-3.2.4/api/video.zig | 253 ++-- castholm/v0.1.5-SDL-3.2.4/json/audio.json | 12 + castholm/v0.1.5-SDL-3.2.4/json/blendmode.json | 6 +- castholm/v0.1.5-SDL-3.2.4/json/events.json | 64 +- .../v0.1.5-SDL-3.2.4/json/filesystem.json | 9 +- castholm/v0.1.5-SDL-3.2.4/json/gamepad.json | 16 + castholm/v0.1.5-SDL-3.2.4/json/gpu.json | 6 +- castholm/v0.1.5-SDL-3.2.4/json/guid.json | 51 + castholm/v0.1.5-SDL-3.2.4/json/haptic.json | 8 + castholm/v0.1.5-SDL-3.2.4/json/iostream.json | 737 ++++++++++ castholm/v0.1.5-SDL-3.2.4/json/joystick.json | 12 + castholm/v0.1.5-SDL-3.2.4/json/keyboard.json | 332 +++++ castholm/v0.1.5-SDL-3.2.4/json/opengl.json | 12 + castholm/v0.1.5-SDL-3.2.4/json/pen.json | 97 ++ castholm/v0.1.5-SDL-3.2.4/json/pixels.json | 383 ++++- castholm/v0.1.5-SDL-3.2.4/json/power.json | 58 + castholm/v0.1.5-SDL-3.2.4/json/process.json | 153 ++ castholm/v0.1.5-SDL-3.2.4/json/scancode.json | 1083 ++++++++++++++ castholm/v0.1.5-SDL-3.2.4/json/system.json | 4 + castholm/v0.1.5-SDL-3.2.4/json/touch.json | 4 + castholm/v0.1.5-SDL-3.2.4/json/tray.json | 332 +++++ castholm/v0.1.5-SDL-3.2.4/json/video.json | 3 +- castholm/v0.2.0-3.2.8/api/audio.zig | 123 +- castholm/v0.2.0-3.2.8/api/blendmode.zig | 7 +- castholm/v0.2.0-3.2.8/api/c.zig | 1 + castholm/v0.2.0-3.2.8/api/camera.zig | 81 +- castholm/v0.2.0-3.2.8/api/clipboard.zig | 9 +- castholm/v0.2.0-3.2.8/api/dialog.zig | 15 +- castholm/v0.2.0-3.2.8/api/error.zig | 4 + castholm/v0.2.0-3.2.8/api/events.zig | 226 +-- castholm/v0.2.0-3.2.8/api/filesystem.zig | 17 +- castholm/v0.2.0-3.2.8/api/gamepad.zig | 187 ++- castholm/v0.2.0-3.2.8/api/gpu.zig | 241 ++-- castholm/v0.2.0-3.2.8/api/guid.zig | 13 + castholm/v0.2.0-3.2.8/api/haptic.zig | 79 +- castholm/v0.2.0-3.2.8/api/hints.zig | 3 +- castholm/v0.2.0-3.2.8/api/init.zig | 6 +- castholm/v0.2.0-3.2.8/api/iostream.zig | 221 +++ castholm/v0.2.0-3.2.8/api/joystick.zig | 154 +- castholm/v0.2.0-3.2.8/api/keyboard.zig | 131 ++ castholm/v0.2.0-3.2.8/api/keycode.zig | 1 - castholm/v0.2.0-3.2.8/api/loadso.zig | 9 +- castholm/v0.2.0-3.2.8/api/messagebox.zig | 16 +- castholm/v0.2.0-3.2.8/api/misc.zig | 1 - castholm/v0.2.0-3.2.8/api/mouse.zig | 69 +- castholm/v0.2.0-3.2.8/api/opengl.zig | 2 + castholm/v0.2.0-3.2.8/api/pen.zig | 28 + castholm/v0.2.0-3.2.8/api/pixels.zig | 132 +- castholm/v0.2.0-3.2.8/api/power.zig | 14 + castholm/v0.2.0-3.2.8/api/process.zig | 52 + castholm/v0.2.0-3.2.8/api/properties.zig | 3 +- castholm/v0.2.0-3.2.8/api/rect.zig | 25 +- castholm/v0.2.0-3.2.8/api/render.zig | 1083 +++----------- castholm/v0.2.0-3.2.8/api/scancode.zig | 253 ++++ castholm/v0.2.0-3.2.8/api/sensor.zig | 29 +- castholm/v0.2.0-3.2.8/api/stdinc.zig | 3 + castholm/v0.2.0-3.2.8/api/storage.zig | 97 +- castholm/v0.2.0-3.2.8/api/surface.zig | 210 +-- castholm/v0.2.0-3.2.8/api/system.zig | 29 +- castholm/v0.2.0-3.2.8/api/time.zig | 15 +- castholm/v0.2.0-3.2.8/api/timer.zig | 1 - castholm/v0.2.0-3.2.8/api/touch.zig | 12 +- castholm/v0.2.0-3.2.8/api/tray.zig | 116 ++ castholm/v0.2.0-3.2.8/api/version.zig | 1 - castholm/v0.2.0-3.2.8/api/video.zig | 254 ++-- castholm/v0.2.0-3.2.8/json/audio.json | 12 + castholm/v0.2.0-3.2.8/json/blendmode.json | 6 +- castholm/v0.2.0-3.2.8/json/events.json | 64 +- castholm/v0.2.0-3.2.8/json/filesystem.json | 9 +- castholm/v0.2.0-3.2.8/json/gamepad.json | 16 + castholm/v0.2.0-3.2.8/json/gpu.json | 6 +- castholm/v0.2.0-3.2.8/json/guid.json | 51 + castholm/v0.2.0-3.2.8/json/haptic.json | 8 + castholm/v0.2.0-3.2.8/json/iostream.json | 737 ++++++++++ castholm/v0.2.0-3.2.8/json/joystick.json | 12 + castholm/v0.2.0-3.2.8/json/keyboard.json | 332 +++++ castholm/v0.2.0-3.2.8/json/opengl.json | 12 + castholm/v0.2.0-3.2.8/json/pen.json | 97 ++ castholm/v0.2.0-3.2.8/json/pixels.json | 383 ++++- castholm/v0.2.0-3.2.8/json/power.json | 58 + castholm/v0.2.0-3.2.8/json/process.json | 153 ++ castholm/v0.2.0-3.2.8/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.0-3.2.8/json/system.json | 4 + castholm/v0.2.0-3.2.8/json/touch.json | 4 + castholm/v0.2.0-3.2.8/json/tray.json | 332 +++++ castholm/v0.2.0-3.2.8/json/video.json | 3 +- castholm/v0.2.1-3.2.10/api/audio.zig | 123 +- castholm/v0.2.1-3.2.10/api/blendmode.zig | 7 +- castholm/v0.2.1-3.2.10/api/c.zig | 1 + castholm/v0.2.1-3.2.10/api/camera.zig | 81 +- castholm/v0.2.1-3.2.10/api/clipboard.zig | 9 +- castholm/v0.2.1-3.2.10/api/dialog.zig | 15 +- castholm/v0.2.1-3.2.10/api/error.zig | 4 + castholm/v0.2.1-3.2.10/api/events.zig | 226 +-- castholm/v0.2.1-3.2.10/api/filesystem.zig | 17 +- castholm/v0.2.1-3.2.10/api/gamepad.zig | 187 ++- castholm/v0.2.1-3.2.10/api/gpu.zig | 241 ++-- castholm/v0.2.1-3.2.10/api/guid.zig | 13 + castholm/v0.2.1-3.2.10/api/haptic.zig | 79 +- castholm/v0.2.1-3.2.10/api/hints.zig | 3 +- castholm/v0.2.1-3.2.10/api/init.zig | 6 +- castholm/v0.2.1-3.2.10/api/iostream.zig | 221 +++ castholm/v0.2.1-3.2.10/api/joystick.zig | 154 +- castholm/v0.2.1-3.2.10/api/keyboard.zig | 131 ++ castholm/v0.2.1-3.2.10/api/keycode.zig | 1 - castholm/v0.2.1-3.2.10/api/loadso.zig | 9 +- castholm/v0.2.1-3.2.10/api/messagebox.zig | 16 +- castholm/v0.2.1-3.2.10/api/misc.zig | 1 - castholm/v0.2.1-3.2.10/api/mouse.zig | 69 +- castholm/v0.2.1-3.2.10/api/opengl.zig | 2 + castholm/v0.2.1-3.2.10/api/pen.zig | 28 + castholm/v0.2.1-3.2.10/api/pixels.zig | 132 +- castholm/v0.2.1-3.2.10/api/power.zig | 14 + castholm/v0.2.1-3.2.10/api/process.zig | 52 + castholm/v0.2.1-3.2.10/api/properties.zig | 3 +- castholm/v0.2.1-3.2.10/api/rect.zig | 25 +- castholm/v0.2.1-3.2.10/api/render.zig | 1083 +++----------- castholm/v0.2.1-3.2.10/api/scancode.zig | 253 ++++ castholm/v0.2.1-3.2.10/api/sensor.zig | 29 +- castholm/v0.2.1-3.2.10/api/stdinc.zig | 3 + castholm/v0.2.1-3.2.10/api/storage.zig | 97 +- castholm/v0.2.1-3.2.10/api/surface.zig | 211 +-- castholm/v0.2.1-3.2.10/api/system.zig | 29 +- castholm/v0.2.1-3.2.10/api/time.zig | 15 +- castholm/v0.2.1-3.2.10/api/timer.zig | 1 - castholm/v0.2.1-3.2.10/api/touch.zig | 12 +- castholm/v0.2.1-3.2.10/api/tray.zig | 116 ++ castholm/v0.2.1-3.2.10/api/version.zig | 1 - castholm/v0.2.1-3.2.10/api/video.zig | 254 ++-- castholm/v0.2.1-3.2.10/json/audio.json | 12 + castholm/v0.2.1-3.2.10/json/blendmode.json | 6 +- castholm/v0.2.1-3.2.10/json/events.json | 64 +- castholm/v0.2.1-3.2.10/json/filesystem.json | 9 +- castholm/v0.2.1-3.2.10/json/gamepad.json | 16 + castholm/v0.2.1-3.2.10/json/gpu.json | 6 +- castholm/v0.2.1-3.2.10/json/guid.json | 51 + castholm/v0.2.1-3.2.10/json/haptic.json | 8 + castholm/v0.2.1-3.2.10/json/iostream.json | 737 ++++++++++ castholm/v0.2.1-3.2.10/json/joystick.json | 12 + castholm/v0.2.1-3.2.10/json/keyboard.json | 332 +++++ castholm/v0.2.1-3.2.10/json/opengl.json | 12 + castholm/v0.2.1-3.2.10/json/pen.json | 97 ++ castholm/v0.2.1-3.2.10/json/pixels.json | 383 ++++- castholm/v0.2.1-3.2.10/json/power.json | 58 + castholm/v0.2.1-3.2.10/json/process.json | 153 ++ castholm/v0.2.1-3.2.10/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.1-3.2.10/json/surface.json | 4 + castholm/v0.2.1-3.2.10/json/system.json | 4 + castholm/v0.2.1-3.2.10/json/touch.json | 4 + castholm/v0.2.1-3.2.10/json/tray.json | 332 +++++ castholm/v0.2.1-3.2.10/json/video.json | 3 +- castholm/v0.2.2-3.2.12/api/audio.zig | 123 +- castholm/v0.2.2-3.2.12/api/blendmode.zig | 7 +- castholm/v0.2.2-3.2.12/api/c.zig | 1 + castholm/v0.2.2-3.2.12/api/camera.zig | 81 +- castholm/v0.2.2-3.2.12/api/clipboard.zig | 9 +- castholm/v0.2.2-3.2.12/api/dialog.zig | 15 +- castholm/v0.2.2-3.2.12/api/error.zig | 4 + castholm/v0.2.2-3.2.12/api/events.zig | 226 +-- castholm/v0.2.2-3.2.12/api/filesystem.zig | 17 +- castholm/v0.2.2-3.2.12/api/gamepad.zig | 187 ++- castholm/v0.2.2-3.2.12/api/gpu.zig | 241 ++-- castholm/v0.2.2-3.2.12/api/guid.zig | 13 + castholm/v0.2.2-3.2.12/api/haptic.zig | 79 +- castholm/v0.2.2-3.2.12/api/hints.zig | 3 +- castholm/v0.2.2-3.2.12/api/init.zig | 6 +- castholm/v0.2.2-3.2.12/api/iostream.zig | 221 +++ castholm/v0.2.2-3.2.12/api/joystick.zig | 154 +- castholm/v0.2.2-3.2.12/api/keyboard.zig | 131 ++ castholm/v0.2.2-3.2.12/api/keycode.zig | 1 - castholm/v0.2.2-3.2.12/api/loadso.zig | 9 +- castholm/v0.2.2-3.2.12/api/messagebox.zig | 16 +- castholm/v0.2.2-3.2.12/api/misc.zig | 1 - castholm/v0.2.2-3.2.12/api/mouse.zig | 69 +- castholm/v0.2.2-3.2.12/api/opengl.zig | 2 + castholm/v0.2.2-3.2.12/api/pen.zig | 28 + castholm/v0.2.2-3.2.12/api/pixels.zig | 132 +- castholm/v0.2.2-3.2.12/api/power.zig | 14 + castholm/v0.2.2-3.2.12/api/process.zig | 52 + castholm/v0.2.2-3.2.12/api/properties.zig | 3 +- castholm/v0.2.2-3.2.12/api/rect.zig | 25 +- castholm/v0.2.2-3.2.12/api/render.zig | 1085 +++----------- castholm/v0.2.2-3.2.12/api/scancode.zig | 253 ++++ castholm/v0.2.2-3.2.12/api/sensor.zig | 29 +- castholm/v0.2.2-3.2.12/api/stdinc.zig | 3 + castholm/v0.2.2-3.2.12/api/storage.zig | 97 +- castholm/v0.2.2-3.2.12/api/surface.zig | 211 +-- castholm/v0.2.2-3.2.12/api/system.zig | 29 +- castholm/v0.2.2-3.2.12/api/time.zig | 15 +- castholm/v0.2.2-3.2.12/api/timer.zig | 1 - castholm/v0.2.2-3.2.12/api/touch.zig | 12 +- castholm/v0.2.2-3.2.12/api/tray.zig | 116 ++ castholm/v0.2.2-3.2.12/api/version.zig | 1 - castholm/v0.2.2-3.2.12/api/video.zig | 254 ++-- castholm/v0.2.2-3.2.12/json/audio.json | 12 + castholm/v0.2.2-3.2.12/json/blendmode.json | 6 +- castholm/v0.2.2-3.2.12/json/events.json | 64 +- castholm/v0.2.2-3.2.12/json/filesystem.json | 9 +- castholm/v0.2.2-3.2.12/json/gamepad.json | 16 + castholm/v0.2.2-3.2.12/json/gpu.json | 6 +- castholm/v0.2.2-3.2.12/json/guid.json | 51 + castholm/v0.2.2-3.2.12/json/haptic.json | 8 + castholm/v0.2.2-3.2.12/json/iostream.json | 737 ++++++++++ castholm/v0.2.2-3.2.12/json/joystick.json | 12 + castholm/v0.2.2-3.2.12/json/keyboard.json | 332 +++++ castholm/v0.2.2-3.2.12/json/opengl.json | 12 + castholm/v0.2.2-3.2.12/json/pen.json | 97 ++ castholm/v0.2.2-3.2.12/json/pixels.json | 383 ++++- castholm/v0.2.2-3.2.12/json/power.json | 58 + castholm/v0.2.2-3.2.12/json/process.json | 153 ++ castholm/v0.2.2-3.2.12/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.2-3.2.12/json/surface.json | 4 + castholm/v0.2.2-3.2.12/json/system.json | 4 + castholm/v0.2.2-3.2.12/json/touch.json | 4 + castholm/v0.2.2-3.2.12/json/tray.json | 332 +++++ castholm/v0.2.2-3.2.12/json/video.json | 3 +- castholm/v0.2.3-3.2.14/api/audio.zig | 123 +- castholm/v0.2.3-3.2.14/api/blendmode.zig | 7 +- castholm/v0.2.3-3.2.14/api/c.zig | 1 + castholm/v0.2.3-3.2.14/api/camera.zig | 81 +- castholm/v0.2.3-3.2.14/api/clipboard.zig | 9 +- castholm/v0.2.3-3.2.14/api/dialog.zig | 15 +- castholm/v0.2.3-3.2.14/api/error.zig | 4 + castholm/v0.2.3-3.2.14/api/events.zig | 226 +-- castholm/v0.2.3-3.2.14/api/filesystem.zig | 17 +- castholm/v0.2.3-3.2.14/api/gamepad.zig | 187 ++- castholm/v0.2.3-3.2.14/api/gpu.zig | 241 ++-- castholm/v0.2.3-3.2.14/api/guid.zig | 13 + castholm/v0.2.3-3.2.14/api/haptic.zig | 79 +- castholm/v0.2.3-3.2.14/api/hints.zig | 3 +- castholm/v0.2.3-3.2.14/api/init.zig | 6 +- castholm/v0.2.3-3.2.14/api/iostream.zig | 221 +++ castholm/v0.2.3-3.2.14/api/joystick.zig | 154 +- castholm/v0.2.3-3.2.14/api/keyboard.zig | 131 ++ castholm/v0.2.3-3.2.14/api/keycode.zig | 1 - castholm/v0.2.3-3.2.14/api/loadso.zig | 9 +- castholm/v0.2.3-3.2.14/api/messagebox.zig | 16 +- castholm/v0.2.3-3.2.14/api/misc.zig | 1 - castholm/v0.2.3-3.2.14/api/mouse.zig | 69 +- castholm/v0.2.3-3.2.14/api/opengl.zig | 2 + castholm/v0.2.3-3.2.14/api/pen.zig | 28 + castholm/v0.2.3-3.2.14/api/pixels.zig | 132 +- castholm/v0.2.3-3.2.14/api/power.zig | 14 + castholm/v0.2.3-3.2.14/api/process.zig | 52 + castholm/v0.2.3-3.2.14/api/properties.zig | 3 +- castholm/v0.2.3-3.2.14/api/rect.zig | 25 +- castholm/v0.2.3-3.2.14/api/render.zig | 1085 +++----------- castholm/v0.2.3-3.2.14/api/scancode.zig | 253 ++++ castholm/v0.2.3-3.2.14/api/sensor.zig | 29 +- castholm/v0.2.3-3.2.14/api/stdinc.zig | 3 + castholm/v0.2.3-3.2.14/api/storage.zig | 97 +- castholm/v0.2.3-3.2.14/api/surface.zig | 211 +-- castholm/v0.2.3-3.2.14/api/system.zig | 29 +- castholm/v0.2.3-3.2.14/api/time.zig | 15 +- castholm/v0.2.3-3.2.14/api/timer.zig | 1 - castholm/v0.2.3-3.2.14/api/touch.zig | 12 +- castholm/v0.2.3-3.2.14/api/tray.zig | 116 ++ castholm/v0.2.3-3.2.14/api/version.zig | 1 - castholm/v0.2.3-3.2.14/api/video.zig | 254 ++-- castholm/v0.2.3-3.2.14/json/audio.json | 12 + castholm/v0.2.3-3.2.14/json/blendmode.json | 6 +- castholm/v0.2.3-3.2.14/json/events.json | 64 +- castholm/v0.2.3-3.2.14/json/filesystem.json | 9 +- castholm/v0.2.3-3.2.14/json/gamepad.json | 16 + castholm/v0.2.3-3.2.14/json/gpu.json | 6 +- castholm/v0.2.3-3.2.14/json/guid.json | 51 + castholm/v0.2.3-3.2.14/json/haptic.json | 8 + castholm/v0.2.3-3.2.14/json/iostream.json | 737 ++++++++++ castholm/v0.2.3-3.2.14/json/joystick.json | 12 + castholm/v0.2.3-3.2.14/json/keyboard.json | 332 +++++ castholm/v0.2.3-3.2.14/json/opengl.json | 12 + castholm/v0.2.3-3.2.14/json/pen.json | 97 ++ castholm/v0.2.3-3.2.14/json/pixels.json | 383 ++++- castholm/v0.2.3-3.2.14/json/power.json | 58 + castholm/v0.2.3-3.2.14/json/process.json | 153 ++ castholm/v0.2.3-3.2.14/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.3-3.2.14/json/surface.json | 4 + castholm/v0.2.3-3.2.14/json/system.json | 4 + castholm/v0.2.3-3.2.14/json/touch.json | 4 + castholm/v0.2.3-3.2.14/json/tray.json | 332 +++++ castholm/v0.2.3-3.2.14/json/video.json | 3 +- castholm/v0.2.4-3.2.16/api/audio.zig | 123 +- castholm/v0.2.4-3.2.16/api/blendmode.zig | 7 +- castholm/v0.2.4-3.2.16/api/c.zig | 1 + castholm/v0.2.4-3.2.16/api/camera.zig | 81 +- castholm/v0.2.4-3.2.16/api/clipboard.zig | 9 +- castholm/v0.2.4-3.2.16/api/dialog.zig | 15 +- castholm/v0.2.4-3.2.16/api/error.zig | 4 + castholm/v0.2.4-3.2.16/api/events.zig | 226 +-- castholm/v0.2.4-3.2.16/api/filesystem.zig | 17 +- castholm/v0.2.4-3.2.16/api/gamepad.zig | 187 ++- castholm/v0.2.4-3.2.16/api/gpu.zig | 241 ++-- castholm/v0.2.4-3.2.16/api/guid.zig | 13 + castholm/v0.2.4-3.2.16/api/haptic.zig | 79 +- castholm/v0.2.4-3.2.16/api/hints.zig | 3 +- castholm/v0.2.4-3.2.16/api/init.zig | 6 +- castholm/v0.2.4-3.2.16/api/iostream.zig | 221 +++ castholm/v0.2.4-3.2.16/api/joystick.zig | 154 +- castholm/v0.2.4-3.2.16/api/keyboard.zig | 131 ++ castholm/v0.2.4-3.2.16/api/keycode.zig | 1 - castholm/v0.2.4-3.2.16/api/loadso.zig | 9 +- castholm/v0.2.4-3.2.16/api/messagebox.zig | 16 +- castholm/v0.2.4-3.2.16/api/misc.zig | 1 - castholm/v0.2.4-3.2.16/api/mouse.zig | 69 +- castholm/v0.2.4-3.2.16/api/opengl.zig | 2 + castholm/v0.2.4-3.2.16/api/pen.zig | 28 + castholm/v0.2.4-3.2.16/api/pixels.zig | 132 +- castholm/v0.2.4-3.2.16/api/power.zig | 14 + castholm/v0.2.4-3.2.16/api/process.zig | 52 + castholm/v0.2.4-3.2.16/api/properties.zig | 3 +- castholm/v0.2.4-3.2.16/api/rect.zig | 25 +- castholm/v0.2.4-3.2.16/api/render.zig | 1085 +++----------- castholm/v0.2.4-3.2.16/api/scancode.zig | 253 ++++ castholm/v0.2.4-3.2.16/api/sensor.zig | 29 +- castholm/v0.2.4-3.2.16/api/stdinc.zig | 3 + castholm/v0.2.4-3.2.16/api/storage.zig | 97 +- castholm/v0.2.4-3.2.16/api/surface.zig | 211 +-- castholm/v0.2.4-3.2.16/api/system.zig | 29 +- castholm/v0.2.4-3.2.16/api/time.zig | 15 +- castholm/v0.2.4-3.2.16/api/timer.zig | 1 - castholm/v0.2.4-3.2.16/api/touch.zig | 12 +- castholm/v0.2.4-3.2.16/api/tray.zig | 116 ++ castholm/v0.2.4-3.2.16/api/version.zig | 1 - castholm/v0.2.4-3.2.16/api/video.zig | 254 ++-- castholm/v0.2.4-3.2.16/json/audio.json | 12 + castholm/v0.2.4-3.2.16/json/blendmode.json | 6 +- castholm/v0.2.4-3.2.16/json/events.json | 64 +- castholm/v0.2.4-3.2.16/json/filesystem.json | 9 +- castholm/v0.2.4-3.2.16/json/gamepad.json | 16 + castholm/v0.2.4-3.2.16/json/gpu.json | 6 +- castholm/v0.2.4-3.2.16/json/guid.json | 51 + castholm/v0.2.4-3.2.16/json/haptic.json | 8 + castholm/v0.2.4-3.2.16/json/iostream.json | 737 ++++++++++ castholm/v0.2.4-3.2.16/json/joystick.json | 12 + castholm/v0.2.4-3.2.16/json/keyboard.json | 332 +++++ castholm/v0.2.4-3.2.16/json/opengl.json | 12 + castholm/v0.2.4-3.2.16/json/pen.json | 97 ++ castholm/v0.2.4-3.2.16/json/pixels.json | 383 ++++- castholm/v0.2.4-3.2.16/json/power.json | 58 + castholm/v0.2.4-3.2.16/json/process.json | 153 ++ castholm/v0.2.4-3.2.16/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.4-3.2.16/json/surface.json | 4 + castholm/v0.2.4-3.2.16/json/system.json | 4 + castholm/v0.2.4-3.2.16/json/touch.json | 4 + castholm/v0.2.4-3.2.16/json/tray.json | 332 +++++ castholm/v0.2.4-3.2.16/json/video.json | 3 +- castholm/v0.2.5-3.2.18/api/audio.zig | 123 +- castholm/v0.2.5-3.2.18/api/blendmode.zig | 7 +- castholm/v0.2.5-3.2.18/api/c.zig | 1 + castholm/v0.2.5-3.2.18/api/camera.zig | 81 +- castholm/v0.2.5-3.2.18/api/clipboard.zig | 9 +- castholm/v0.2.5-3.2.18/api/dialog.zig | 15 +- castholm/v0.2.5-3.2.18/api/error.zig | 4 + castholm/v0.2.5-3.2.18/api/events.zig | 226 +-- castholm/v0.2.5-3.2.18/api/filesystem.zig | 17 +- castholm/v0.2.5-3.2.18/api/gamepad.zig | 187 ++- castholm/v0.2.5-3.2.18/api/gpu.zig | 241 ++-- castholm/v0.2.5-3.2.18/api/guid.zig | 13 + castholm/v0.2.5-3.2.18/api/haptic.zig | 79 +- castholm/v0.2.5-3.2.18/api/hints.zig | 3 +- castholm/v0.2.5-3.2.18/api/init.zig | 6 +- castholm/v0.2.5-3.2.18/api/iostream.zig | 221 +++ castholm/v0.2.5-3.2.18/api/joystick.zig | 154 +- castholm/v0.2.5-3.2.18/api/keyboard.zig | 131 ++ castholm/v0.2.5-3.2.18/api/keycode.zig | 1 - castholm/v0.2.5-3.2.18/api/loadso.zig | 9 +- castholm/v0.2.5-3.2.18/api/messagebox.zig | 16 +- castholm/v0.2.5-3.2.18/api/misc.zig | 1 - castholm/v0.2.5-3.2.18/api/mouse.zig | 69 +- castholm/v0.2.5-3.2.18/api/opengl.zig | 2 + castholm/v0.2.5-3.2.18/api/pen.zig | 28 + castholm/v0.2.5-3.2.18/api/pixels.zig | 132 +- castholm/v0.2.5-3.2.18/api/power.zig | 14 + castholm/v0.2.5-3.2.18/api/process.zig | 52 + castholm/v0.2.5-3.2.18/api/properties.zig | 3 +- castholm/v0.2.5-3.2.18/api/rect.zig | 25 +- castholm/v0.2.5-3.2.18/api/render.zig | 1085 +++----------- castholm/v0.2.5-3.2.18/api/scancode.zig | 253 ++++ castholm/v0.2.5-3.2.18/api/sensor.zig | 29 +- castholm/v0.2.5-3.2.18/api/stdinc.zig | 3 + castholm/v0.2.5-3.2.18/api/storage.zig | 97 +- castholm/v0.2.5-3.2.18/api/surface.zig | 211 +-- castholm/v0.2.5-3.2.18/api/system.zig | 29 +- castholm/v0.2.5-3.2.18/api/time.zig | 15 +- castholm/v0.2.5-3.2.18/api/timer.zig | 1 - castholm/v0.2.5-3.2.18/api/touch.zig | 12 +- castholm/v0.2.5-3.2.18/api/tray.zig | 116 ++ castholm/v0.2.5-3.2.18/api/version.zig | 1 - castholm/v0.2.5-3.2.18/api/video.zig | 254 ++-- castholm/v0.2.5-3.2.18/json/audio.json | 12 + castholm/v0.2.5-3.2.18/json/blendmode.json | 6 +- castholm/v0.2.5-3.2.18/json/events.json | 64 +- castholm/v0.2.5-3.2.18/json/filesystem.json | 9 +- castholm/v0.2.5-3.2.18/json/gamepad.json | 16 + castholm/v0.2.5-3.2.18/json/gpu.json | 6 +- castholm/v0.2.5-3.2.18/json/guid.json | 51 + castholm/v0.2.5-3.2.18/json/haptic.json | 8 + castholm/v0.2.5-3.2.18/json/iostream.json | 737 ++++++++++ castholm/v0.2.5-3.2.18/json/joystick.json | 12 + castholm/v0.2.5-3.2.18/json/keyboard.json | 332 +++++ castholm/v0.2.5-3.2.18/json/opengl.json | 12 + castholm/v0.2.5-3.2.18/json/pen.json | 97 ++ castholm/v0.2.5-3.2.18/json/pixels.json | 383 ++++- castholm/v0.2.5-3.2.18/json/power.json | 58 + castholm/v0.2.5-3.2.18/json/process.json | 153 ++ castholm/v0.2.5-3.2.18/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.5-3.2.18/json/surface.json | 4 + castholm/v0.2.5-3.2.18/json/system.json | 4 + castholm/v0.2.5-3.2.18/json/touch.json | 4 + castholm/v0.2.5-3.2.18/json/tray.json | 332 +++++ castholm/v0.2.5-3.2.18/json/video.json | 3 +- castholm/v0.2.6-3.2.20/api/audio.zig | 123 +- castholm/v0.2.6-3.2.20/api/blendmode.zig | 7 +- castholm/v0.2.6-3.2.20/api/c.zig | 1 + castholm/v0.2.6-3.2.20/api/camera.zig | 81 +- castholm/v0.2.6-3.2.20/api/clipboard.zig | 9 +- castholm/v0.2.6-3.2.20/api/dialog.zig | 15 +- castholm/v0.2.6-3.2.20/api/error.zig | 4 + castholm/v0.2.6-3.2.20/api/events.zig | 226 +-- castholm/v0.2.6-3.2.20/api/filesystem.zig | 17 +- castholm/v0.2.6-3.2.20/api/gamepad.zig | 187 ++- castholm/v0.2.6-3.2.20/api/gpu.zig | 241 ++-- castholm/v0.2.6-3.2.20/api/guid.zig | 13 + castholm/v0.2.6-3.2.20/api/haptic.zig | 79 +- castholm/v0.2.6-3.2.20/api/hints.zig | 3 +- castholm/v0.2.6-3.2.20/api/init.zig | 6 +- castholm/v0.2.6-3.2.20/api/iostream.zig | 221 +++ castholm/v0.2.6-3.2.20/api/joystick.zig | 154 +- castholm/v0.2.6-3.2.20/api/keyboard.zig | 131 ++ castholm/v0.2.6-3.2.20/api/keycode.zig | 1 - castholm/v0.2.6-3.2.20/api/loadso.zig | 9 +- castholm/v0.2.6-3.2.20/api/messagebox.zig | 16 +- castholm/v0.2.6-3.2.20/api/misc.zig | 1 - castholm/v0.2.6-3.2.20/api/mouse.zig | 69 +- castholm/v0.2.6-3.2.20/api/opengl.zig | 2 + castholm/v0.2.6-3.2.20/api/pen.zig | 28 + castholm/v0.2.6-3.2.20/api/pixels.zig | 132 +- castholm/v0.2.6-3.2.20/api/power.zig | 14 + castholm/v0.2.6-3.2.20/api/process.zig | 52 + castholm/v0.2.6-3.2.20/api/properties.zig | 3 +- castholm/v0.2.6-3.2.20/api/rect.zig | 25 +- castholm/v0.2.6-3.2.20/api/render.zig | 1085 +++----------- castholm/v0.2.6-3.2.20/api/scancode.zig | 253 ++++ castholm/v0.2.6-3.2.20/api/sensor.zig | 29 +- castholm/v0.2.6-3.2.20/api/stdinc.zig | 3 + castholm/v0.2.6-3.2.20/api/storage.zig | 97 +- castholm/v0.2.6-3.2.20/api/surface.zig | 211 +-- castholm/v0.2.6-3.2.20/api/system.zig | 29 +- castholm/v0.2.6-3.2.20/api/time.zig | 15 +- castholm/v0.2.6-3.2.20/api/timer.zig | 1 - castholm/v0.2.6-3.2.20/api/touch.zig | 12 +- castholm/v0.2.6-3.2.20/api/tray.zig | 116 ++ castholm/v0.2.6-3.2.20/api/version.zig | 1 - castholm/v0.2.6-3.2.20/api/video.zig | 254 ++-- castholm/v0.2.6-3.2.20/json/audio.json | 12 + castholm/v0.2.6-3.2.20/json/blendmode.json | 6 +- castholm/v0.2.6-3.2.20/json/events.json | 64 +- castholm/v0.2.6-3.2.20/json/filesystem.json | 9 +- castholm/v0.2.6-3.2.20/json/gamepad.json | 16 + castholm/v0.2.6-3.2.20/json/gpu.json | 6 +- castholm/v0.2.6-3.2.20/json/guid.json | 51 + castholm/v0.2.6-3.2.20/json/haptic.json | 8 + castholm/v0.2.6-3.2.20/json/iostream.json | 737 ++++++++++ castholm/v0.2.6-3.2.20/json/joystick.json | 12 + castholm/v0.2.6-3.2.20/json/keyboard.json | 332 +++++ castholm/v0.2.6-3.2.20/json/opengl.json | 12 + castholm/v0.2.6-3.2.20/json/pen.json | 97 ++ castholm/v0.2.6-3.2.20/json/pixels.json | 383 ++++- castholm/v0.2.6-3.2.20/json/power.json | 58 + castholm/v0.2.6-3.2.20/json/process.json | 153 ++ castholm/v0.2.6-3.2.20/json/scancode.json | 1083 ++++++++++++++ castholm/v0.2.6-3.2.20/json/surface.json | 4 + castholm/v0.2.6-3.2.20/json/system.json | 4 + castholm/v0.2.6-3.2.20/json/touch.json | 4 + castholm/v0.2.6-3.2.20/json/tray.json | 332 +++++ castholm/v0.2.6-3.2.20/json/video.json | 3 +- castholm/v0.3.0-3.2.22/api/audio.zig | 123 +- castholm/v0.3.0-3.2.22/api/blendmode.zig | 7 +- castholm/v0.3.0-3.2.22/api/c.zig | 1 + castholm/v0.3.0-3.2.22/api/camera.zig | 81 +- castholm/v0.3.0-3.2.22/api/clipboard.zig | 9 +- castholm/v0.3.0-3.2.22/api/dialog.zig | 15 +- castholm/v0.3.0-3.2.22/api/error.zig | 4 + castholm/v0.3.0-3.2.22/api/events.zig | 226 +-- castholm/v0.3.0-3.2.22/api/filesystem.zig | 17 +- castholm/v0.3.0-3.2.22/api/gamepad.zig | 188 ++- castholm/v0.3.0-3.2.22/api/gpu.zig | 241 ++-- castholm/v0.3.0-3.2.22/api/guid.zig | 13 + castholm/v0.3.0-3.2.22/api/haptic.zig | 79 +- castholm/v0.3.0-3.2.22/api/hints.zig | 3 +- castholm/v0.3.0-3.2.22/api/init.zig | 6 +- castholm/v0.3.0-3.2.22/api/iostream.zig | 221 +++ castholm/v0.3.0-3.2.22/api/joystick.zig | 155 +- castholm/v0.3.0-3.2.22/api/keyboard.zig | 131 ++ castholm/v0.3.0-3.2.22/api/keycode.zig | 1 - castholm/v0.3.0-3.2.22/api/loadso.zig | 9 +- castholm/v0.3.0-3.2.22/api/messagebox.zig | 16 +- castholm/v0.3.0-3.2.22/api/misc.zig | 1 - castholm/v0.3.0-3.2.22/api/mouse.zig | 69 +- castholm/v0.3.0-3.2.22/api/opengl.zig | 2 + castholm/v0.3.0-3.2.22/api/pen.zig | 28 + castholm/v0.3.0-3.2.22/api/pixels.zig | 132 +- castholm/v0.3.0-3.2.22/api/power.zig | 14 + castholm/v0.3.0-3.2.22/api/process.zig | 52 + castholm/v0.3.0-3.2.22/api/properties.zig | 3 +- castholm/v0.3.0-3.2.22/api/rect.zig | 25 +- castholm/v0.3.0-3.2.22/api/render.zig | 1085 +++----------- castholm/v0.3.0-3.2.22/api/scancode.zig | 253 ++++ castholm/v0.3.0-3.2.22/api/sensor.zig | 29 +- castholm/v0.3.0-3.2.22/api/stdinc.zig | 3 + castholm/v0.3.0-3.2.22/api/storage.zig | 97 +- castholm/v0.3.0-3.2.22/api/surface.zig | 211 +-- castholm/v0.3.0-3.2.22/api/system.zig | 29 +- castholm/v0.3.0-3.2.22/api/time.zig | 15 +- castholm/v0.3.0-3.2.22/api/timer.zig | 1 - castholm/v0.3.0-3.2.22/api/touch.zig | 12 +- castholm/v0.3.0-3.2.22/api/tray.zig | 116 ++ castholm/v0.3.0-3.2.22/api/version.zig | 1 - castholm/v0.3.0-3.2.22/api/video.zig | 254 ++-- castholm/v0.3.0-3.2.22/json/audio.json | 12 + castholm/v0.3.0-3.2.22/json/blendmode.json | 6 +- castholm/v0.3.0-3.2.22/json/events.json | 64 +- castholm/v0.3.0-3.2.22/json/filesystem.json | 9 +- castholm/v0.3.0-3.2.22/json/gamepad.json | 16 + castholm/v0.3.0-3.2.22/json/gpu.json | 6 +- castholm/v0.3.0-3.2.22/json/guid.json | 51 + castholm/v0.3.0-3.2.22/json/haptic.json | 8 + castholm/v0.3.0-3.2.22/json/iostream.json | 737 ++++++++++ castholm/v0.3.0-3.2.22/json/joystick.json | 12 + castholm/v0.3.0-3.2.22/json/keyboard.json | 332 +++++ castholm/v0.3.0-3.2.22/json/opengl.json | 12 + castholm/v0.3.0-3.2.22/json/pen.json | 97 ++ castholm/v0.3.0-3.2.22/json/pixels.json | 383 ++++- castholm/v0.3.0-3.2.22/json/power.json | 58 + castholm/v0.3.0-3.2.22/json/process.json | 153 ++ castholm/v0.3.0-3.2.22/json/scancode.json | 1083 ++++++++++++++ castholm/v0.3.0-3.2.22/json/surface.json | 4 + castholm/v0.3.0-3.2.22/json/system.json | 4 + castholm/v0.3.0-3.2.22/json/touch.json | 4 + castholm/v0.3.0-3.2.22/json/tray.json | 332 +++++ castholm/v0.3.0-3.2.22/json/video.json | 3 +- castholm/v0.3.1-3.2.24/api/audio.zig | 123 +- castholm/v0.3.1-3.2.24/api/blendmode.zig | 7 +- castholm/v0.3.1-3.2.24/api/c.zig | 1 + castholm/v0.3.1-3.2.24/api/camera.zig | 81 +- castholm/v0.3.1-3.2.24/api/clipboard.zig | 9 +- castholm/v0.3.1-3.2.24/api/dialog.zig | 15 +- castholm/v0.3.1-3.2.24/api/error.zig | 4 + castholm/v0.3.1-3.2.24/api/events.zig | 226 +-- castholm/v0.3.1-3.2.24/api/filesystem.zig | 17 +- castholm/v0.3.1-3.2.24/api/gamepad.zig | 188 ++- castholm/v0.3.1-3.2.24/api/gpu.zig | 241 ++-- castholm/v0.3.1-3.2.24/api/guid.zig | 13 + castholm/v0.3.1-3.2.24/api/haptic.zig | 79 +- castholm/v0.3.1-3.2.24/api/hints.zig | 3 +- castholm/v0.3.1-3.2.24/api/init.zig | 6 +- castholm/v0.3.1-3.2.24/api/iostream.zig | 221 +++ castholm/v0.3.1-3.2.24/api/joystick.zig | 155 +- castholm/v0.3.1-3.2.24/api/keyboard.zig | 131 ++ castholm/v0.3.1-3.2.24/api/keycode.zig | 1 - castholm/v0.3.1-3.2.24/api/loadso.zig | 9 +- castholm/v0.3.1-3.2.24/api/messagebox.zig | 16 +- castholm/v0.3.1-3.2.24/api/misc.zig | 1 - castholm/v0.3.1-3.2.24/api/mouse.zig | 69 +- castholm/v0.3.1-3.2.24/api/opengl.zig | 2 + castholm/v0.3.1-3.2.24/api/pen.zig | 28 + castholm/v0.3.1-3.2.24/api/pixels.zig | 132 +- castholm/v0.3.1-3.2.24/api/power.zig | 14 + castholm/v0.3.1-3.2.24/api/process.zig | 52 + castholm/v0.3.1-3.2.24/api/properties.zig | 3 +- castholm/v0.3.1-3.2.24/api/rect.zig | 25 +- castholm/v0.3.1-3.2.24/api/render.zig | 1085 +++----------- castholm/v0.3.1-3.2.24/api/scancode.zig | 253 ++++ castholm/v0.3.1-3.2.24/api/sensor.zig | 29 +- castholm/v0.3.1-3.2.24/api/stdinc.zig | 3 + castholm/v0.3.1-3.2.24/api/storage.zig | 97 +- castholm/v0.3.1-3.2.24/api/surface.zig | 211 +-- castholm/v0.3.1-3.2.24/api/system.zig | 29 +- castholm/v0.3.1-3.2.24/api/time.zig | 15 +- castholm/v0.3.1-3.2.24/api/timer.zig | 1 - castholm/v0.3.1-3.2.24/api/touch.zig | 12 +- castholm/v0.3.1-3.2.24/api/tray.zig | 116 ++ castholm/v0.3.1-3.2.24/api/version.zig | 1 - castholm/v0.3.1-3.2.24/api/video.zig | 254 ++-- castholm/v0.3.1-3.2.24/json/audio.json | 12 + castholm/v0.3.1-3.2.24/json/blendmode.json | 6 +- castholm/v0.3.1-3.2.24/json/events.json | 64 +- castholm/v0.3.1-3.2.24/json/filesystem.json | 9 +- castholm/v0.3.1-3.2.24/json/gamepad.json | 16 + castholm/v0.3.1-3.2.24/json/gpu.json | 6 +- castholm/v0.3.1-3.2.24/json/guid.json | 51 + castholm/v0.3.1-3.2.24/json/haptic.json | 8 + castholm/v0.3.1-3.2.24/json/iostream.json | 737 ++++++++++ castholm/v0.3.1-3.2.24/json/joystick.json | 12 + castholm/v0.3.1-3.2.24/json/keyboard.json | 332 +++++ castholm/v0.3.1-3.2.24/json/opengl.json | 12 + castholm/v0.3.1-3.2.24/json/pen.json | 97 ++ castholm/v0.3.1-3.2.24/json/pixels.json | 383 ++++- castholm/v0.3.1-3.2.24/json/power.json | 58 + castholm/v0.3.1-3.2.24/json/process.json | 153 ++ castholm/v0.3.1-3.2.24/json/scancode.json | 1083 ++++++++++++++ castholm/v0.3.1-3.2.24/json/surface.json | 4 + castholm/v0.3.1-3.2.24/json/system.json | 4 + castholm/v0.3.1-3.2.24/json/touch.json | 4 + castholm/v0.3.1-3.2.24/json/tray.json | 332 +++++ castholm/v0.3.1-3.2.24/json/video.json | 3 +- castholm/v0.3.2-3.2.26/api/audio.zig | 123 +- castholm/v0.3.2-3.2.26/api/blendmode.zig | 7 +- castholm/v0.3.2-3.2.26/api/c.zig | 1 + castholm/v0.3.2-3.2.26/api/camera.zig | 81 +- castholm/v0.3.2-3.2.26/api/clipboard.zig | 9 +- castholm/v0.3.2-3.2.26/api/dialog.zig | 15 +- castholm/v0.3.2-3.2.26/api/error.zig | 4 + castholm/v0.3.2-3.2.26/api/events.zig | 226 +-- castholm/v0.3.2-3.2.26/api/filesystem.zig | 17 +- castholm/v0.3.2-3.2.26/api/gamepad.zig | 188 ++- castholm/v0.3.2-3.2.26/api/gpu.zig | 241 ++-- castholm/v0.3.2-3.2.26/api/guid.zig | 13 + castholm/v0.3.2-3.2.26/api/haptic.zig | 79 +- castholm/v0.3.2-3.2.26/api/hints.zig | 3 +- castholm/v0.3.2-3.2.26/api/init.zig | 6 +- castholm/v0.3.2-3.2.26/api/iostream.zig | 221 +++ castholm/v0.3.2-3.2.26/api/joystick.zig | 155 +- castholm/v0.3.2-3.2.26/api/keyboard.zig | 131 ++ castholm/v0.3.2-3.2.26/api/keycode.zig | 1 - castholm/v0.3.2-3.2.26/api/loadso.zig | 9 +- castholm/v0.3.2-3.2.26/api/messagebox.zig | 16 +- castholm/v0.3.2-3.2.26/api/misc.zig | 1 - castholm/v0.3.2-3.2.26/api/mouse.zig | 69 +- castholm/v0.3.2-3.2.26/api/opengl.zig | 2 + castholm/v0.3.2-3.2.26/api/pen.zig | 28 + castholm/v0.3.2-3.2.26/api/pixels.zig | 132 +- castholm/v0.3.2-3.2.26/api/power.zig | 14 + castholm/v0.3.2-3.2.26/api/process.zig | 52 + castholm/v0.3.2-3.2.26/api/properties.zig | 3 +- castholm/v0.3.2-3.2.26/api/rect.zig | 25 +- castholm/v0.3.2-3.2.26/api/render.zig | 1085 +++----------- castholm/v0.3.2-3.2.26/api/scancode.zig | 253 ++++ castholm/v0.3.2-3.2.26/api/sensor.zig | 29 +- castholm/v0.3.2-3.2.26/api/stdinc.zig | 3 + castholm/v0.3.2-3.2.26/api/storage.zig | 97 +- castholm/v0.3.2-3.2.26/api/surface.zig | 211 +-- castholm/v0.3.2-3.2.26/api/system.zig | 29 +- castholm/v0.3.2-3.2.26/api/time.zig | 15 +- castholm/v0.3.2-3.2.26/api/timer.zig | 1 - castholm/v0.3.2-3.2.26/api/touch.zig | 12 +- castholm/v0.3.2-3.2.26/api/tray.zig | 116 ++ castholm/v0.3.2-3.2.26/api/version.zig | 1 - castholm/v0.3.2-3.2.26/api/video.zig | 254 ++-- castholm/v0.3.2-3.2.26/json/audio.json | 12 + castholm/v0.3.2-3.2.26/json/blendmode.json | 6 +- castholm/v0.3.2-3.2.26/json/events.json | 64 +- castholm/v0.3.2-3.2.26/json/filesystem.json | 9 +- castholm/v0.3.2-3.2.26/json/gamepad.json | 16 + castholm/v0.3.2-3.2.26/json/gpu.json | 6 +- castholm/v0.3.2-3.2.26/json/guid.json | 51 + castholm/v0.3.2-3.2.26/json/haptic.json | 8 + castholm/v0.3.2-3.2.26/json/iostream.json | 737 ++++++++++ castholm/v0.3.2-3.2.26/json/joystick.json | 12 + castholm/v0.3.2-3.2.26/json/keyboard.json | 332 +++++ castholm/v0.3.2-3.2.26/json/opengl.json | 12 + castholm/v0.3.2-3.2.26/json/pen.json | 97 ++ castholm/v0.3.2-3.2.26/json/pixels.json | 383 ++++- castholm/v0.3.2-3.2.26/json/power.json | 58 + castholm/v0.3.2-3.2.26/json/process.json | 153 ++ castholm/v0.3.2-3.2.26/json/scancode.json | 1083 ++++++++++++++ castholm/v0.3.2-3.2.26/json/surface.json | 4 + castholm/v0.3.2-3.2.26/json/system.json | 4 + castholm/v0.3.2-3.2.26/json/touch.json | 4 + castholm/v0.3.2-3.2.26/json/tray.json | 332 +++++ castholm/v0.3.2-3.2.26/json/video.json | 3 +- castholm/v0.3.3-3.2.28/api/audio.zig | 123 +- castholm/v0.3.3-3.2.28/api/blendmode.zig | 7 +- castholm/v0.3.3-3.2.28/api/c.zig | 1 + castholm/v0.3.3-3.2.28/api/camera.zig | 81 +- castholm/v0.3.3-3.2.28/api/clipboard.zig | 9 +- castholm/v0.3.3-3.2.28/api/dialog.zig | 15 +- castholm/v0.3.3-3.2.28/api/error.zig | 4 + castholm/v0.3.3-3.2.28/api/events.zig | 226 +-- castholm/v0.3.3-3.2.28/api/filesystem.zig | 17 +- castholm/v0.3.3-3.2.28/api/gamepad.zig | 188 ++- castholm/v0.3.3-3.2.28/api/gpu.zig | 241 ++-- castholm/v0.3.3-3.2.28/api/guid.zig | 13 + castholm/v0.3.3-3.2.28/api/haptic.zig | 79 +- castholm/v0.3.3-3.2.28/api/hints.zig | 3 +- castholm/v0.3.3-3.2.28/api/init.zig | 6 +- castholm/v0.3.3-3.2.28/api/iostream.zig | 221 +++ castholm/v0.3.3-3.2.28/api/joystick.zig | 155 +- castholm/v0.3.3-3.2.28/api/keyboard.zig | 131 ++ castholm/v0.3.3-3.2.28/api/keycode.zig | 1 - castholm/v0.3.3-3.2.28/api/loadso.zig | 9 +- castholm/v0.3.3-3.2.28/api/messagebox.zig | 16 +- castholm/v0.3.3-3.2.28/api/misc.zig | 1 - castholm/v0.3.3-3.2.28/api/mouse.zig | 69 +- castholm/v0.3.3-3.2.28/api/opengl.zig | 2 + castholm/v0.3.3-3.2.28/api/pen.zig | 28 + castholm/v0.3.3-3.2.28/api/pixels.zig | 132 +- castholm/v0.3.3-3.2.28/api/power.zig | 14 + castholm/v0.3.3-3.2.28/api/process.zig | 52 + castholm/v0.3.3-3.2.28/api/properties.zig | 3 +- castholm/v0.3.3-3.2.28/api/rect.zig | 25 +- castholm/v0.3.3-3.2.28/api/render.zig | 1085 +++----------- castholm/v0.3.3-3.2.28/api/scancode.zig | 253 ++++ castholm/v0.3.3-3.2.28/api/sensor.zig | 29 +- castholm/v0.3.3-3.2.28/api/stdinc.zig | 3 + castholm/v0.3.3-3.2.28/api/storage.zig | 97 +- castholm/v0.3.3-3.2.28/api/surface.zig | 211 +-- castholm/v0.3.3-3.2.28/api/system.zig | 29 +- castholm/v0.3.3-3.2.28/api/time.zig | 15 +- castholm/v0.3.3-3.2.28/api/timer.zig | 1 - castholm/v0.3.3-3.2.28/api/touch.zig | 12 +- castholm/v0.3.3-3.2.28/api/tray.zig | 116 ++ castholm/v0.3.3-3.2.28/api/version.zig | 1 - castholm/v0.3.3-3.2.28/api/video.zig | 254 ++-- castholm/v0.3.3-3.2.28/json/audio.json | 12 + castholm/v0.3.3-3.2.28/json/blendmode.json | 6 +- castholm/v0.3.3-3.2.28/json/events.json | 64 +- castholm/v0.3.3-3.2.28/json/filesystem.json | 9 +- castholm/v0.3.3-3.2.28/json/gamepad.json | 16 + castholm/v0.3.3-3.2.28/json/gpu.json | 6 +- castholm/v0.3.3-3.2.28/json/guid.json | 51 + castholm/v0.3.3-3.2.28/json/haptic.json | 8 + castholm/v0.3.3-3.2.28/json/iostream.json | 737 ++++++++++ castholm/v0.3.3-3.2.28/json/joystick.json | 12 + castholm/v0.3.3-3.2.28/json/keyboard.json | 332 +++++ castholm/v0.3.3-3.2.28/json/opengl.json | 12 + castholm/v0.3.3-3.2.28/json/pen.json | 97 ++ castholm/v0.3.3-3.2.28/json/pixels.json | 383 ++++- castholm/v0.3.3-3.2.28/json/power.json | 58 + castholm/v0.3.3-3.2.28/json/process.json | 153 ++ castholm/v0.3.3-3.2.28/json/scancode.json | 1083 ++++++++++++++ castholm/v0.3.3-3.2.28/json/surface.json | 4 + castholm/v0.3.3-3.2.28/json/system.json | 4 + castholm/v0.3.3-3.2.28/json/touch.json | 4 + castholm/v0.3.3-3.2.28/json/tray.json | 332 +++++ castholm/v0.3.3-3.2.28/json/video.json | 3 +- castholm/v0.4.0-3.4.0/api/audio.zig | 172 +-- castholm/v0.4.0-3.4.0/api/blendmode.zig | 7 +- castholm/v0.4.0-3.4.0/api/c.zig | 1 + castholm/v0.4.0-3.4.0/api/camera.zig | 95 ++ castholm/v0.4.0-3.4.0/api/clipboard.zig | 23 +- castholm/v0.4.0-3.4.0/api/dialog.zig | 19 +- castholm/v0.4.0-3.4.0/api/error.zig | 8 +- castholm/v0.4.0-3.4.0/api/events.zig | 239 +--- castholm/v0.4.0-3.4.0/api/filesystem.zig | 29 +- castholm/v0.4.0-3.4.0/api/gamepad.zig | 200 ++- .../SDL_gpu_h_fmterror.zig => api/gpu.zig} | 331 +++-- castholm/v0.4.0-3.4.0/api/guid.zig | 13 + castholm/v0.4.0-3.4.0/api/haptic.zig | 87 +- castholm/v0.4.0-3.4.0/api/hints.zig | 11 +- castholm/v0.4.0-3.4.0/api/init.zig | 20 +- castholm/v0.4.0-3.4.0/api/iostream.zig | 221 +++ castholm/v0.4.0-3.4.0/api/joystick.zig | 167 +-- castholm/v0.4.0-3.4.0/api/keyboard.zig | 131 ++ castholm/v0.4.0-3.4.0/api/keycode.zig | 1 - castholm/v0.4.0-3.4.0/api/loadso.zig | 9 +- castholm/v0.4.0-3.4.0/api/messagebox.zig | 20 +- castholm/v0.4.0-3.4.0/api/misc.zig | 3 +- castholm/v0.4.0-3.4.0/api/mouse.zig | 89 +- castholm/v0.4.0-3.4.0/api/opengl.zig | 2 + castholm/v0.4.0-3.4.0/api/pen.zig | 39 + castholm/v0.4.0-3.4.0/api/pixels.zig | 311 ++++ castholm/v0.4.0-3.4.0/api/power.zig | 14 + castholm/v0.4.0-3.4.0/api/process.zig | 52 + castholm/v0.4.0-3.4.0/api/properties.zig | 27 +- castholm/v0.4.0-3.4.0/api/rect.zig | 41 +- castholm/v0.4.0-3.4.0/api/render.zig | 553 +++++++ castholm/v0.4.0-3.4.0/api/scancode.zig | 253 ++++ castholm/v0.4.0-3.4.0/api/sensor.zig | 29 +- castholm/v0.4.0-3.4.0/api/stdinc.zig | 3 + castholm/v0.4.0-3.4.0/api/storage.zig | 97 +- castholm/v0.4.0-3.4.0/api/surface.zig | 305 ++++ castholm/v0.4.0-3.4.0/api/system.zig | 49 +- castholm/v0.4.0-3.4.0/api/time.zig | 17 +- castholm/v0.4.0-3.4.0/api/timer.zig | 3 +- castholm/v0.4.0-3.4.0/api/touch.zig | 12 +- castholm/v0.4.0-3.4.0/api/tray.zig | 116 ++ castholm/v0.4.0-3.4.0/api/version.zig | 1 - castholm/v0.4.0-3.4.0/api/video.zig | 623 ++++++++ .../debug/SDL_camera_h_fmterror.zig | 132 -- .../debug/SDL_pixels_h_fmterror.zig | 238 ---- .../debug/SDL_render_h_fmterror.zig | 1267 ----------------- .../debug/SDL_surface_h_fmterror.zig | 355 ----- .../v0.4.0-3.4.0/debug/error_SDL_audio_h.zig | 269 ---- castholm/v0.4.0-3.4.0/json/audio.json | 12 + castholm/v0.4.0-3.4.0/json/blendmode.json | 6 +- castholm/v0.4.0-3.4.0/json/camera.json | 4 + castholm/v0.4.0-3.4.0/json/events.json | 67 +- castholm/v0.4.0-3.4.0/json/filesystem.json | 9 +- castholm/v0.4.0-3.4.0/json/gamepad.json | 16 + castholm/v0.4.0-3.4.0/json/gpu.json | 49 +- castholm/v0.4.0-3.4.0/json/guid.json | 51 + castholm/v0.4.0-3.4.0/json/haptic.json | 8 + castholm/v0.4.0-3.4.0/json/init.json | 16 +- castholm/v0.4.0-3.4.0/json/iostream.json | 737 ++++++++++ castholm/v0.4.0-3.4.0/json/joystick.json | 12 + castholm/v0.4.0-3.4.0/json/keyboard.json | 332 +++++ castholm/v0.4.0-3.4.0/json/messagebox.json | 14 +- castholm/v0.4.0-3.4.0/json/mouse.json | 14 +- castholm/v0.4.0-3.4.0/json/opengl.json | 12 + castholm/v0.4.0-3.4.0/json/pen.json | 135 ++ castholm/v0.4.0-3.4.0/json/pixels.json | 383 ++++- castholm/v0.4.0-3.4.0/json/power.json | 58 + castholm/v0.4.0-3.4.0/json/process.json | 153 ++ castholm/v0.4.0-3.4.0/json/render.json | 4 + castholm/v0.4.0-3.4.0/json/scancode.json | 1083 ++++++++++++++ castholm/v0.4.0-3.4.0/json/surface.json | 15 +- castholm/v0.4.0-3.4.0/json/system.json | 4 + castholm/v0.4.0-3.4.0/json/touch.json | 4 + castholm/v0.4.0-3.4.0/json/tray.json | 332 +++++ castholm/v0.4.0-3.4.0/json/video.json | 55 +- official/release-3.2.0/api/audio.zig | 123 +- official/release-3.2.0/api/blendmode.zig | 7 +- official/release-3.2.0/api/c.zig | 1 + official/release-3.2.0/api/camera.zig | 80 +- official/release-3.2.0/api/clipboard.zig | 9 +- official/release-3.2.0/api/dialog.zig | 15 +- official/release-3.2.0/api/error.zig | 4 + official/release-3.2.0/api/events.zig | 226 +-- official/release-3.2.0/api/filesystem.zig | 17 +- official/release-3.2.0/api/gamepad.zig | 187 ++- official/release-3.2.0/api/gpu.zig | 241 ++-- official/release-3.2.0/api/guid.zig | 13 + official/release-3.2.0/api/haptic.zig | 79 +- official/release-3.2.0/api/hints.zig | 3 +- official/release-3.2.0/api/init.zig | 6 +- official/release-3.2.0/api/iostream.zig | 221 +++ official/release-3.2.0/api/joystick.zig | 154 +- official/release-3.2.0/api/keyboard.zig | 131 ++ official/release-3.2.0/api/keycode.zig | 1 - official/release-3.2.0/api/loadso.zig | 9 +- official/release-3.2.0/api/messagebox.zig | 16 +- official/release-3.2.0/api/misc.zig | 1 - official/release-3.2.0/api/mouse.zig | 69 +- official/release-3.2.0/api/opengl.zig | 2 + official/release-3.2.0/api/pen.zig | 28 + official/release-3.2.0/api/pixels.zig | 132 +- official/release-3.2.0/api/power.zig | 14 + official/release-3.2.0/api/process.zig | 52 + official/release-3.2.0/api/properties.zig | 3 +- official/release-3.2.0/api/rect.zig | 25 +- official/release-3.2.0/api/render.zig | 1082 +++----------- official/release-3.2.0/api/scancode.zig | 253 ++++ official/release-3.2.0/api/sensor.zig | 29 +- official/release-3.2.0/api/stdinc.zig | 3 + official/release-3.2.0/api/storage.zig | 97 +- official/release-3.2.0/api/surface.zig | 207 +-- official/release-3.2.0/api/system.zig | 29 +- official/release-3.2.0/api/time.zig | 15 +- official/release-3.2.0/api/timer.zig | 1 - official/release-3.2.0/api/touch.zig | 12 +- official/release-3.2.0/api/tray.zig | 116 ++ official/release-3.2.0/api/version.zig | 1 - official/release-3.2.0/api/video.zig | 253 ++-- official/release-3.2.0/json/audio.json | 12 + official/release-3.2.0/json/blendmode.json | 6 +- official/release-3.2.0/json/events.json | 64 +- official/release-3.2.0/json/filesystem.json | 9 +- official/release-3.2.0/json/gamepad.json | 16 + official/release-3.2.0/json/gpu.json | 6 +- official/release-3.2.0/json/guid.json | 51 + official/release-3.2.0/json/haptic.json | 8 + official/release-3.2.0/json/iostream.json | 737 ++++++++++ official/release-3.2.0/json/joystick.json | 12 + official/release-3.2.0/json/keyboard.json | 332 +++++ official/release-3.2.0/json/opengl.json | 12 + official/release-3.2.0/json/pen.json | 97 ++ official/release-3.2.0/json/pixels.json | 383 ++++- official/release-3.2.0/json/power.json | 58 + official/release-3.2.0/json/process.json | 153 ++ official/release-3.2.0/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.0/json/system.json | 4 + official/release-3.2.0/json/touch.json | 4 + official/release-3.2.0/json/tray.json | 332 +++++ official/release-3.2.0/json/video.json | 3 +- official/release-3.2.10/api/audio.zig | 123 +- official/release-3.2.10/api/blendmode.zig | 7 +- official/release-3.2.10/api/c.zig | 1 + official/release-3.2.10/api/camera.zig | 81 +- official/release-3.2.10/api/clipboard.zig | 9 +- official/release-3.2.10/api/dialog.zig | 15 +- official/release-3.2.10/api/error.zig | 4 + official/release-3.2.10/api/events.zig | 226 +-- official/release-3.2.10/api/filesystem.zig | 17 +- official/release-3.2.10/api/gamepad.zig | 187 ++- official/release-3.2.10/api/gpu.zig | 241 ++-- official/release-3.2.10/api/guid.zig | 13 + official/release-3.2.10/api/haptic.zig | 79 +- official/release-3.2.10/api/hints.zig | 3 +- official/release-3.2.10/api/init.zig | 6 +- official/release-3.2.10/api/iostream.zig | 221 +++ official/release-3.2.10/api/joystick.zig | 154 +- official/release-3.2.10/api/keyboard.zig | 131 ++ official/release-3.2.10/api/keycode.zig | 1 - official/release-3.2.10/api/loadso.zig | 9 +- official/release-3.2.10/api/messagebox.zig | 16 +- official/release-3.2.10/api/misc.zig | 1 - official/release-3.2.10/api/mouse.zig | 69 +- official/release-3.2.10/api/opengl.zig | 2 + official/release-3.2.10/api/pen.zig | 28 + official/release-3.2.10/api/pixels.zig | 132 +- official/release-3.2.10/api/power.zig | 14 + official/release-3.2.10/api/process.zig | 52 + official/release-3.2.10/api/properties.zig | 3 +- official/release-3.2.10/api/rect.zig | 25 +- official/release-3.2.10/api/render.zig | 1083 +++----------- official/release-3.2.10/api/scancode.zig | 253 ++++ official/release-3.2.10/api/sensor.zig | 29 +- official/release-3.2.10/api/stdinc.zig | 3 + official/release-3.2.10/api/storage.zig | 97 +- official/release-3.2.10/api/surface.zig | 211 +-- official/release-3.2.10/api/system.zig | 29 +- official/release-3.2.10/api/time.zig | 15 +- official/release-3.2.10/api/timer.zig | 1 - official/release-3.2.10/api/touch.zig | 12 +- official/release-3.2.10/api/tray.zig | 116 ++ official/release-3.2.10/api/version.zig | 1 - official/release-3.2.10/api/video.zig | 254 ++-- official/release-3.2.10/json/audio.json | 12 + official/release-3.2.10/json/blendmode.json | 6 +- official/release-3.2.10/json/events.json | 64 +- official/release-3.2.10/json/filesystem.json | 9 +- official/release-3.2.10/json/gamepad.json | 16 + official/release-3.2.10/json/gpu.json | 6 +- official/release-3.2.10/json/guid.json | 51 + official/release-3.2.10/json/haptic.json | 8 + official/release-3.2.10/json/iostream.json | 737 ++++++++++ official/release-3.2.10/json/joystick.json | 12 + official/release-3.2.10/json/keyboard.json | 332 +++++ official/release-3.2.10/json/opengl.json | 12 + official/release-3.2.10/json/pen.json | 97 ++ official/release-3.2.10/json/pixels.json | 383 ++++- official/release-3.2.10/json/power.json | 58 + official/release-3.2.10/json/process.json | 153 ++ official/release-3.2.10/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.10/json/surface.json | 4 + official/release-3.2.10/json/system.json | 4 + official/release-3.2.10/json/touch.json | 4 + official/release-3.2.10/json/tray.json | 332 +++++ official/release-3.2.10/json/video.json | 3 +- official/release-3.2.12/api/audio.zig | 123 +- official/release-3.2.12/api/blendmode.zig | 7 +- official/release-3.2.12/api/c.zig | 1 + official/release-3.2.12/api/camera.zig | 81 +- official/release-3.2.12/api/clipboard.zig | 9 +- official/release-3.2.12/api/dialog.zig | 15 +- official/release-3.2.12/api/error.zig | 4 + official/release-3.2.12/api/events.zig | 226 +-- official/release-3.2.12/api/filesystem.zig | 17 +- official/release-3.2.12/api/gamepad.zig | 187 ++- official/release-3.2.12/api/gpu.zig | 241 ++-- official/release-3.2.12/api/guid.zig | 13 + official/release-3.2.12/api/haptic.zig | 79 +- official/release-3.2.12/api/hints.zig | 3 +- official/release-3.2.12/api/init.zig | 6 +- official/release-3.2.12/api/iostream.zig | 221 +++ official/release-3.2.12/api/joystick.zig | 154 +- official/release-3.2.12/api/keyboard.zig | 131 ++ official/release-3.2.12/api/keycode.zig | 1 - official/release-3.2.12/api/loadso.zig | 9 +- official/release-3.2.12/api/messagebox.zig | 16 +- official/release-3.2.12/api/misc.zig | 1 - official/release-3.2.12/api/mouse.zig | 69 +- official/release-3.2.12/api/opengl.zig | 2 + official/release-3.2.12/api/pen.zig | 28 + official/release-3.2.12/api/pixels.zig | 132 +- official/release-3.2.12/api/power.zig | 14 + official/release-3.2.12/api/process.zig | 52 + official/release-3.2.12/api/properties.zig | 3 +- official/release-3.2.12/api/rect.zig | 25 +- official/release-3.2.12/api/render.zig | 1085 +++----------- official/release-3.2.12/api/scancode.zig | 253 ++++ official/release-3.2.12/api/sensor.zig | 29 +- official/release-3.2.12/api/stdinc.zig | 3 + official/release-3.2.12/api/storage.zig | 97 +- official/release-3.2.12/api/surface.zig | 211 +-- official/release-3.2.12/api/system.zig | 29 +- official/release-3.2.12/api/time.zig | 15 +- official/release-3.2.12/api/timer.zig | 1 - official/release-3.2.12/api/touch.zig | 12 +- official/release-3.2.12/api/tray.zig | 116 ++ official/release-3.2.12/api/version.zig | 1 - official/release-3.2.12/api/video.zig | 254 ++-- official/release-3.2.12/json/audio.json | 12 + official/release-3.2.12/json/blendmode.json | 6 +- official/release-3.2.12/json/events.json | 64 +- official/release-3.2.12/json/filesystem.json | 9 +- official/release-3.2.12/json/gamepad.json | 16 + official/release-3.2.12/json/gpu.json | 6 +- official/release-3.2.12/json/guid.json | 51 + official/release-3.2.12/json/haptic.json | 8 + official/release-3.2.12/json/iostream.json | 737 ++++++++++ official/release-3.2.12/json/joystick.json | 12 + official/release-3.2.12/json/keyboard.json | 332 +++++ official/release-3.2.12/json/opengl.json | 12 + official/release-3.2.12/json/pen.json | 97 ++ official/release-3.2.12/json/pixels.json | 383 ++++- official/release-3.2.12/json/power.json | 58 + official/release-3.2.12/json/process.json | 153 ++ official/release-3.2.12/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.12/json/surface.json | 4 + official/release-3.2.12/json/system.json | 4 + official/release-3.2.12/json/touch.json | 4 + official/release-3.2.12/json/tray.json | 332 +++++ official/release-3.2.12/json/video.json | 3 +- official/release-3.2.14/api/audio.zig | 123 +- official/release-3.2.14/api/blendmode.zig | 7 +- official/release-3.2.14/api/c.zig | 1 + official/release-3.2.14/api/camera.zig | 81 +- official/release-3.2.14/api/clipboard.zig | 9 +- official/release-3.2.14/api/dialog.zig | 15 +- official/release-3.2.14/api/error.zig | 4 + official/release-3.2.14/api/events.zig | 226 +-- official/release-3.2.14/api/filesystem.zig | 17 +- official/release-3.2.14/api/gamepad.zig | 187 ++- official/release-3.2.14/api/gpu.zig | 241 ++-- official/release-3.2.14/api/guid.zig | 13 + official/release-3.2.14/api/haptic.zig | 79 +- official/release-3.2.14/api/hints.zig | 3 +- official/release-3.2.14/api/init.zig | 6 +- official/release-3.2.14/api/iostream.zig | 221 +++ official/release-3.2.14/api/joystick.zig | 154 +- official/release-3.2.14/api/keyboard.zig | 131 ++ official/release-3.2.14/api/keycode.zig | 1 - official/release-3.2.14/api/loadso.zig | 9 +- official/release-3.2.14/api/messagebox.zig | 16 +- official/release-3.2.14/api/misc.zig | 1 - official/release-3.2.14/api/mouse.zig | 69 +- official/release-3.2.14/api/opengl.zig | 2 + official/release-3.2.14/api/pen.zig | 28 + official/release-3.2.14/api/pixels.zig | 132 +- official/release-3.2.14/api/power.zig | 14 + official/release-3.2.14/api/process.zig | 52 + official/release-3.2.14/api/properties.zig | 3 +- official/release-3.2.14/api/rect.zig | 25 +- official/release-3.2.14/api/render.zig | 1085 +++----------- official/release-3.2.14/api/scancode.zig | 253 ++++ official/release-3.2.14/api/sensor.zig | 29 +- official/release-3.2.14/api/stdinc.zig | 3 + official/release-3.2.14/api/storage.zig | 97 +- official/release-3.2.14/api/surface.zig | 211 +-- official/release-3.2.14/api/system.zig | 29 +- official/release-3.2.14/api/time.zig | 15 +- official/release-3.2.14/api/timer.zig | 1 - official/release-3.2.14/api/touch.zig | 12 +- official/release-3.2.14/api/tray.zig | 116 ++ official/release-3.2.14/api/version.zig | 1 - official/release-3.2.14/api/video.zig | 254 ++-- official/release-3.2.14/json/audio.json | 12 + official/release-3.2.14/json/blendmode.json | 6 +- official/release-3.2.14/json/events.json | 64 +- official/release-3.2.14/json/filesystem.json | 9 +- official/release-3.2.14/json/gamepad.json | 16 + official/release-3.2.14/json/gpu.json | 6 +- official/release-3.2.14/json/guid.json | 51 + official/release-3.2.14/json/haptic.json | 8 + official/release-3.2.14/json/iostream.json | 737 ++++++++++ official/release-3.2.14/json/joystick.json | 12 + official/release-3.2.14/json/keyboard.json | 332 +++++ official/release-3.2.14/json/opengl.json | 12 + official/release-3.2.14/json/pen.json | 97 ++ official/release-3.2.14/json/pixels.json | 383 ++++- official/release-3.2.14/json/power.json | 58 + official/release-3.2.14/json/process.json | 153 ++ official/release-3.2.14/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.14/json/surface.json | 4 + official/release-3.2.14/json/system.json | 4 + official/release-3.2.14/json/touch.json | 4 + official/release-3.2.14/json/tray.json | 332 +++++ official/release-3.2.14/json/video.json | 3 +- official/release-3.2.16/api/audio.zig | 123 +- official/release-3.2.16/api/blendmode.zig | 7 +- official/release-3.2.16/api/c.zig | 1 + official/release-3.2.16/api/camera.zig | 81 +- official/release-3.2.16/api/clipboard.zig | 9 +- official/release-3.2.16/api/dialog.zig | 15 +- official/release-3.2.16/api/error.zig | 4 + official/release-3.2.16/api/events.zig | 226 +-- official/release-3.2.16/api/filesystem.zig | 17 +- official/release-3.2.16/api/gamepad.zig | 187 ++- official/release-3.2.16/api/gpu.zig | 241 ++-- official/release-3.2.16/api/guid.zig | 13 + official/release-3.2.16/api/haptic.zig | 79 +- official/release-3.2.16/api/hints.zig | 3 +- official/release-3.2.16/api/init.zig | 6 +- official/release-3.2.16/api/iostream.zig | 221 +++ official/release-3.2.16/api/joystick.zig | 154 +- official/release-3.2.16/api/keyboard.zig | 131 ++ official/release-3.2.16/api/keycode.zig | 1 - official/release-3.2.16/api/loadso.zig | 9 +- official/release-3.2.16/api/messagebox.zig | 16 +- official/release-3.2.16/api/misc.zig | 1 - official/release-3.2.16/api/mouse.zig | 69 +- official/release-3.2.16/api/opengl.zig | 2 + official/release-3.2.16/api/pen.zig | 28 + official/release-3.2.16/api/pixels.zig | 132 +- official/release-3.2.16/api/power.zig | 14 + official/release-3.2.16/api/process.zig | 52 + official/release-3.2.16/api/properties.zig | 3 +- official/release-3.2.16/api/rect.zig | 25 +- official/release-3.2.16/api/render.zig | 1085 +++----------- official/release-3.2.16/api/scancode.zig | 253 ++++ official/release-3.2.16/api/sensor.zig | 29 +- official/release-3.2.16/api/stdinc.zig | 3 + official/release-3.2.16/api/storage.zig | 97 +- official/release-3.2.16/api/surface.zig | 211 +-- official/release-3.2.16/api/system.zig | 29 +- official/release-3.2.16/api/time.zig | 15 +- official/release-3.2.16/api/timer.zig | 1 - official/release-3.2.16/api/touch.zig | 12 +- official/release-3.2.16/api/tray.zig | 116 ++ official/release-3.2.16/api/version.zig | 1 - official/release-3.2.16/api/video.zig | 254 ++-- official/release-3.2.16/json/audio.json | 12 + official/release-3.2.16/json/blendmode.json | 6 +- official/release-3.2.16/json/events.json | 64 +- official/release-3.2.16/json/filesystem.json | 9 +- official/release-3.2.16/json/gamepad.json | 16 + official/release-3.2.16/json/gpu.json | 6 +- official/release-3.2.16/json/guid.json | 51 + official/release-3.2.16/json/haptic.json | 8 + official/release-3.2.16/json/iostream.json | 737 ++++++++++ official/release-3.2.16/json/joystick.json | 12 + official/release-3.2.16/json/keyboard.json | 332 +++++ official/release-3.2.16/json/opengl.json | 12 + official/release-3.2.16/json/pen.json | 97 ++ official/release-3.2.16/json/pixels.json | 383 ++++- official/release-3.2.16/json/power.json | 58 + official/release-3.2.16/json/process.json | 153 ++ official/release-3.2.16/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.16/json/surface.json | 4 + official/release-3.2.16/json/system.json | 4 + official/release-3.2.16/json/touch.json | 4 + official/release-3.2.16/json/tray.json | 332 +++++ official/release-3.2.16/json/video.json | 3 +- official/release-3.2.18/api/audio.zig | 123 +- official/release-3.2.18/api/blendmode.zig | 7 +- official/release-3.2.18/api/c.zig | 1 + official/release-3.2.18/api/camera.zig | 81 +- official/release-3.2.18/api/clipboard.zig | 9 +- official/release-3.2.18/api/dialog.zig | 15 +- official/release-3.2.18/api/error.zig | 4 + official/release-3.2.18/api/events.zig | 226 +-- official/release-3.2.18/api/filesystem.zig | 17 +- official/release-3.2.18/api/gamepad.zig | 187 ++- official/release-3.2.18/api/gpu.zig | 241 ++-- official/release-3.2.18/api/guid.zig | 13 + official/release-3.2.18/api/haptic.zig | 79 +- official/release-3.2.18/api/hints.zig | 3 +- official/release-3.2.18/api/init.zig | 6 +- official/release-3.2.18/api/iostream.zig | 221 +++ official/release-3.2.18/api/joystick.zig | 154 +- official/release-3.2.18/api/keyboard.zig | 131 ++ official/release-3.2.18/api/keycode.zig | 1 - official/release-3.2.18/api/loadso.zig | 9 +- official/release-3.2.18/api/messagebox.zig | 16 +- official/release-3.2.18/api/misc.zig | 1 - official/release-3.2.18/api/mouse.zig | 69 +- official/release-3.2.18/api/opengl.zig | 2 + official/release-3.2.18/api/pen.zig | 28 + official/release-3.2.18/api/pixels.zig | 132 +- official/release-3.2.18/api/power.zig | 14 + official/release-3.2.18/api/process.zig | 52 + official/release-3.2.18/api/properties.zig | 3 +- official/release-3.2.18/api/rect.zig | 25 +- official/release-3.2.18/api/render.zig | 1085 +++----------- official/release-3.2.18/api/scancode.zig | 253 ++++ official/release-3.2.18/api/sensor.zig | 29 +- official/release-3.2.18/api/stdinc.zig | 3 + official/release-3.2.18/api/storage.zig | 97 +- official/release-3.2.18/api/surface.zig | 211 +-- official/release-3.2.18/api/system.zig | 29 +- official/release-3.2.18/api/time.zig | 15 +- official/release-3.2.18/api/timer.zig | 1 - official/release-3.2.18/api/touch.zig | 12 +- official/release-3.2.18/api/tray.zig | 116 ++ official/release-3.2.18/api/version.zig | 1 - official/release-3.2.18/api/video.zig | 254 ++-- official/release-3.2.18/json/audio.json | 12 + official/release-3.2.18/json/blendmode.json | 6 +- official/release-3.2.18/json/events.json | 64 +- official/release-3.2.18/json/filesystem.json | 9 +- official/release-3.2.18/json/gamepad.json | 16 + official/release-3.2.18/json/gpu.json | 6 +- official/release-3.2.18/json/guid.json | 51 + official/release-3.2.18/json/haptic.json | 8 + official/release-3.2.18/json/iostream.json | 737 ++++++++++ official/release-3.2.18/json/joystick.json | 12 + official/release-3.2.18/json/keyboard.json | 332 +++++ official/release-3.2.18/json/opengl.json | 12 + official/release-3.2.18/json/pen.json | 97 ++ official/release-3.2.18/json/pixels.json | 383 ++++- official/release-3.2.18/json/power.json | 58 + official/release-3.2.18/json/process.json | 153 ++ official/release-3.2.18/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.18/json/surface.json | 4 + official/release-3.2.18/json/system.json | 4 + official/release-3.2.18/json/touch.json | 4 + official/release-3.2.18/json/tray.json | 332 +++++ official/release-3.2.18/json/video.json | 3 +- official/release-3.2.2/api/audio.zig | 123 +- official/release-3.2.2/api/blendmode.zig | 7 +- official/release-3.2.2/api/c.zig | 1 + official/release-3.2.2/api/camera.zig | 80 +- official/release-3.2.2/api/clipboard.zig | 9 +- official/release-3.2.2/api/dialog.zig | 15 +- official/release-3.2.2/api/error.zig | 4 + official/release-3.2.2/api/events.zig | 226 +-- official/release-3.2.2/api/filesystem.zig | 17 +- official/release-3.2.2/api/gamepad.zig | 187 ++- official/release-3.2.2/api/gpu.zig | 241 ++-- official/release-3.2.2/api/guid.zig | 13 + official/release-3.2.2/api/haptic.zig | 79 +- official/release-3.2.2/api/hints.zig | 3 +- official/release-3.2.2/api/init.zig | 6 +- official/release-3.2.2/api/iostream.zig | 221 +++ official/release-3.2.2/api/joystick.zig | 154 +- official/release-3.2.2/api/keyboard.zig | 131 ++ official/release-3.2.2/api/keycode.zig | 1 - official/release-3.2.2/api/loadso.zig | 9 +- official/release-3.2.2/api/messagebox.zig | 16 +- official/release-3.2.2/api/misc.zig | 1 - official/release-3.2.2/api/mouse.zig | 69 +- official/release-3.2.2/api/opengl.zig | 2 + official/release-3.2.2/api/pen.zig | 28 + official/release-3.2.2/api/pixels.zig | 132 +- official/release-3.2.2/api/power.zig | 14 + official/release-3.2.2/api/process.zig | 52 + official/release-3.2.2/api/properties.zig | 3 +- official/release-3.2.2/api/rect.zig | 25 +- official/release-3.2.2/api/render.zig | 1082 +++----------- official/release-3.2.2/api/scancode.zig | 253 ++++ official/release-3.2.2/api/sensor.zig | 29 +- official/release-3.2.2/api/stdinc.zig | 3 + official/release-3.2.2/api/storage.zig | 97 +- official/release-3.2.2/api/surface.zig | 207 +-- official/release-3.2.2/api/system.zig | 29 +- official/release-3.2.2/api/time.zig | 15 +- official/release-3.2.2/api/timer.zig | 1 - official/release-3.2.2/api/touch.zig | 12 +- official/release-3.2.2/api/tray.zig | 116 ++ official/release-3.2.2/api/version.zig | 1 - official/release-3.2.2/api/video.zig | 253 ++-- official/release-3.2.2/json/audio.json | 12 + official/release-3.2.2/json/blendmode.json | 6 +- official/release-3.2.2/json/events.json | 64 +- official/release-3.2.2/json/filesystem.json | 9 +- official/release-3.2.2/json/gamepad.json | 16 + official/release-3.2.2/json/gpu.json | 6 +- official/release-3.2.2/json/guid.json | 51 + official/release-3.2.2/json/haptic.json | 8 + official/release-3.2.2/json/iostream.json | 737 ++++++++++ official/release-3.2.2/json/joystick.json | 12 + official/release-3.2.2/json/keyboard.json | 332 +++++ official/release-3.2.2/json/opengl.json | 12 + official/release-3.2.2/json/pen.json | 97 ++ official/release-3.2.2/json/pixels.json | 383 ++++- official/release-3.2.2/json/power.json | 58 + official/release-3.2.2/json/process.json | 153 ++ official/release-3.2.2/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.2/json/system.json | 4 + official/release-3.2.2/json/touch.json | 4 + official/release-3.2.2/json/tray.json | 332 +++++ official/release-3.2.2/json/video.json | 3 +- official/release-3.2.20/api/audio.zig | 123 +- official/release-3.2.20/api/blendmode.zig | 7 +- official/release-3.2.20/api/c.zig | 1 + official/release-3.2.20/api/camera.zig | 81 +- official/release-3.2.20/api/clipboard.zig | 9 +- official/release-3.2.20/api/dialog.zig | 15 +- official/release-3.2.20/api/error.zig | 4 + official/release-3.2.20/api/events.zig | 226 +-- official/release-3.2.20/api/filesystem.zig | 17 +- official/release-3.2.20/api/gamepad.zig | 187 ++- official/release-3.2.20/api/gpu.zig | 241 ++-- official/release-3.2.20/api/guid.zig | 13 + official/release-3.2.20/api/haptic.zig | 79 +- official/release-3.2.20/api/hints.zig | 3 +- official/release-3.2.20/api/init.zig | 6 +- official/release-3.2.20/api/iostream.zig | 221 +++ official/release-3.2.20/api/joystick.zig | 154 +- official/release-3.2.20/api/keyboard.zig | 131 ++ official/release-3.2.20/api/keycode.zig | 1 - official/release-3.2.20/api/loadso.zig | 9 +- official/release-3.2.20/api/messagebox.zig | 16 +- official/release-3.2.20/api/misc.zig | 1 - official/release-3.2.20/api/mouse.zig | 69 +- official/release-3.2.20/api/opengl.zig | 2 + official/release-3.2.20/api/pen.zig | 28 + official/release-3.2.20/api/pixels.zig | 132 +- official/release-3.2.20/api/power.zig | 14 + official/release-3.2.20/api/process.zig | 52 + official/release-3.2.20/api/properties.zig | 3 +- official/release-3.2.20/api/rect.zig | 25 +- official/release-3.2.20/api/render.zig | 1085 +++----------- official/release-3.2.20/api/scancode.zig | 253 ++++ official/release-3.2.20/api/sensor.zig | 29 +- official/release-3.2.20/api/stdinc.zig | 3 + official/release-3.2.20/api/storage.zig | 97 +- official/release-3.2.20/api/surface.zig | 211 +-- official/release-3.2.20/api/system.zig | 29 +- official/release-3.2.20/api/time.zig | 15 +- official/release-3.2.20/api/timer.zig | 1 - official/release-3.2.20/api/touch.zig | 12 +- official/release-3.2.20/api/tray.zig | 116 ++ official/release-3.2.20/api/version.zig | 1 - official/release-3.2.20/api/video.zig | 254 ++-- official/release-3.2.20/json/audio.json | 12 + official/release-3.2.20/json/blendmode.json | 6 +- official/release-3.2.20/json/events.json | 64 +- official/release-3.2.20/json/filesystem.json | 9 +- official/release-3.2.20/json/gamepad.json | 16 + official/release-3.2.20/json/gpu.json | 6 +- official/release-3.2.20/json/guid.json | 51 + official/release-3.2.20/json/haptic.json | 8 + official/release-3.2.20/json/iostream.json | 737 ++++++++++ official/release-3.2.20/json/joystick.json | 12 + official/release-3.2.20/json/keyboard.json | 332 +++++ official/release-3.2.20/json/opengl.json | 12 + official/release-3.2.20/json/pen.json | 97 ++ official/release-3.2.20/json/pixels.json | 383 ++++- official/release-3.2.20/json/power.json | 58 + official/release-3.2.20/json/process.json | 153 ++ official/release-3.2.20/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.20/json/surface.json | 4 + official/release-3.2.20/json/system.json | 4 + official/release-3.2.20/json/touch.json | 4 + official/release-3.2.20/json/tray.json | 332 +++++ official/release-3.2.20/json/video.json | 3 +- official/release-3.2.22/api/audio.zig | 123 +- official/release-3.2.22/api/blendmode.zig | 7 +- official/release-3.2.22/api/c.zig | 1 + official/release-3.2.22/api/camera.zig | 81 +- official/release-3.2.22/api/clipboard.zig | 9 +- official/release-3.2.22/api/dialog.zig | 15 +- official/release-3.2.22/api/error.zig | 4 + official/release-3.2.22/api/events.zig | 226 +-- official/release-3.2.22/api/filesystem.zig | 17 +- official/release-3.2.22/api/gamepad.zig | 188 ++- official/release-3.2.22/api/gpu.zig | 241 ++-- official/release-3.2.22/api/guid.zig | 13 + official/release-3.2.22/api/haptic.zig | 79 +- official/release-3.2.22/api/hints.zig | 3 +- official/release-3.2.22/api/init.zig | 6 +- official/release-3.2.22/api/iostream.zig | 221 +++ official/release-3.2.22/api/joystick.zig | 155 +- official/release-3.2.22/api/keyboard.zig | 131 ++ official/release-3.2.22/api/keycode.zig | 1 - official/release-3.2.22/api/loadso.zig | 9 +- official/release-3.2.22/api/messagebox.zig | 16 +- official/release-3.2.22/api/misc.zig | 1 - official/release-3.2.22/api/mouse.zig | 69 +- official/release-3.2.22/api/opengl.zig | 2 + official/release-3.2.22/api/pen.zig | 28 + official/release-3.2.22/api/pixels.zig | 132 +- official/release-3.2.22/api/power.zig | 14 + official/release-3.2.22/api/process.zig | 52 + official/release-3.2.22/api/properties.zig | 3 +- official/release-3.2.22/api/rect.zig | 25 +- official/release-3.2.22/api/render.zig | 1085 +++----------- official/release-3.2.22/api/scancode.zig | 253 ++++ official/release-3.2.22/api/sensor.zig | 29 +- official/release-3.2.22/api/stdinc.zig | 3 + official/release-3.2.22/api/storage.zig | 97 +- official/release-3.2.22/api/surface.zig | 211 +-- official/release-3.2.22/api/system.zig | 29 +- official/release-3.2.22/api/time.zig | 15 +- official/release-3.2.22/api/timer.zig | 1 - official/release-3.2.22/api/touch.zig | 12 +- official/release-3.2.22/api/tray.zig | 116 ++ official/release-3.2.22/api/version.zig | 1 - official/release-3.2.22/api/video.zig | 254 ++-- official/release-3.2.22/json/audio.json | 12 + official/release-3.2.22/json/blendmode.json | 6 +- official/release-3.2.22/json/events.json | 64 +- official/release-3.2.22/json/filesystem.json | 9 +- official/release-3.2.22/json/gamepad.json | 16 + official/release-3.2.22/json/gpu.json | 6 +- official/release-3.2.22/json/guid.json | 51 + official/release-3.2.22/json/haptic.json | 8 + official/release-3.2.22/json/iostream.json | 737 ++++++++++ official/release-3.2.22/json/joystick.json | 12 + official/release-3.2.22/json/keyboard.json | 332 +++++ official/release-3.2.22/json/opengl.json | 12 + official/release-3.2.22/json/pen.json | 97 ++ official/release-3.2.22/json/pixels.json | 383 ++++- official/release-3.2.22/json/power.json | 58 + official/release-3.2.22/json/process.json | 153 ++ official/release-3.2.22/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.22/json/surface.json | 4 + official/release-3.2.22/json/system.json | 4 + official/release-3.2.22/json/touch.json | 4 + official/release-3.2.22/json/tray.json | 332 +++++ official/release-3.2.22/json/video.json | 3 +- official/release-3.2.24/api/audio.zig | 123 +- official/release-3.2.24/api/blendmode.zig | 7 +- official/release-3.2.24/api/c.zig | 1 + official/release-3.2.24/api/camera.zig | 81 +- official/release-3.2.24/api/clipboard.zig | 9 +- official/release-3.2.24/api/dialog.zig | 15 +- official/release-3.2.24/api/error.zig | 4 + official/release-3.2.24/api/events.zig | 226 +-- official/release-3.2.24/api/filesystem.zig | 17 +- official/release-3.2.24/api/gamepad.zig | 188 ++- official/release-3.2.24/api/gpu.zig | 241 ++-- official/release-3.2.24/api/guid.zig | 13 + official/release-3.2.24/api/haptic.zig | 79 +- official/release-3.2.24/api/hints.zig | 3 +- official/release-3.2.24/api/init.zig | 6 +- official/release-3.2.24/api/iostream.zig | 221 +++ official/release-3.2.24/api/joystick.zig | 155 +- official/release-3.2.24/api/keyboard.zig | 131 ++ official/release-3.2.24/api/keycode.zig | 1 - official/release-3.2.24/api/loadso.zig | 9 +- official/release-3.2.24/api/messagebox.zig | 16 +- official/release-3.2.24/api/misc.zig | 1 - official/release-3.2.24/api/mouse.zig | 69 +- official/release-3.2.24/api/opengl.zig | 2 + official/release-3.2.24/api/pen.zig | 28 + official/release-3.2.24/api/pixels.zig | 132 +- official/release-3.2.24/api/power.zig | 14 + official/release-3.2.24/api/process.zig | 52 + official/release-3.2.24/api/properties.zig | 3 +- official/release-3.2.24/api/rect.zig | 25 +- official/release-3.2.24/api/render.zig | 1085 +++----------- official/release-3.2.24/api/scancode.zig | 253 ++++ official/release-3.2.24/api/sensor.zig | 29 +- official/release-3.2.24/api/stdinc.zig | 3 + official/release-3.2.24/api/storage.zig | 97 +- official/release-3.2.24/api/surface.zig | 211 +-- official/release-3.2.24/api/system.zig | 29 +- official/release-3.2.24/api/time.zig | 15 +- official/release-3.2.24/api/timer.zig | 1 - official/release-3.2.24/api/touch.zig | 12 +- official/release-3.2.24/api/tray.zig | 116 ++ official/release-3.2.24/api/version.zig | 1 - official/release-3.2.24/api/video.zig | 254 ++-- official/release-3.2.24/json/audio.json | 12 + official/release-3.2.24/json/blendmode.json | 6 +- official/release-3.2.24/json/events.json | 64 +- official/release-3.2.24/json/filesystem.json | 9 +- official/release-3.2.24/json/gamepad.json | 16 + official/release-3.2.24/json/gpu.json | 6 +- official/release-3.2.24/json/guid.json | 51 + official/release-3.2.24/json/haptic.json | 8 + official/release-3.2.24/json/iostream.json | 737 ++++++++++ official/release-3.2.24/json/joystick.json | 12 + official/release-3.2.24/json/keyboard.json | 332 +++++ official/release-3.2.24/json/opengl.json | 12 + official/release-3.2.24/json/pen.json | 97 ++ official/release-3.2.24/json/pixels.json | 383 ++++- official/release-3.2.24/json/power.json | 58 + official/release-3.2.24/json/process.json | 153 ++ official/release-3.2.24/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.24/json/surface.json | 4 + official/release-3.2.24/json/system.json | 4 + official/release-3.2.24/json/touch.json | 4 + official/release-3.2.24/json/tray.json | 332 +++++ official/release-3.2.24/json/video.json | 3 +- official/release-3.2.26/api/audio.zig | 123 +- official/release-3.2.26/api/blendmode.zig | 7 +- official/release-3.2.26/api/c.zig | 1 + official/release-3.2.26/api/camera.zig | 81 +- official/release-3.2.26/api/clipboard.zig | 9 +- official/release-3.2.26/api/dialog.zig | 15 +- official/release-3.2.26/api/error.zig | 4 + official/release-3.2.26/api/events.zig | 226 +-- official/release-3.2.26/api/filesystem.zig | 17 +- official/release-3.2.26/api/gamepad.zig | 188 ++- official/release-3.2.26/api/gpu.zig | 241 ++-- official/release-3.2.26/api/guid.zig | 13 + official/release-3.2.26/api/haptic.zig | 79 +- official/release-3.2.26/api/hints.zig | 3 +- official/release-3.2.26/api/init.zig | 6 +- official/release-3.2.26/api/iostream.zig | 221 +++ official/release-3.2.26/api/joystick.zig | 155 +- official/release-3.2.26/api/keyboard.zig | 131 ++ official/release-3.2.26/api/keycode.zig | 1 - official/release-3.2.26/api/loadso.zig | 9 +- official/release-3.2.26/api/messagebox.zig | 16 +- official/release-3.2.26/api/misc.zig | 1 - official/release-3.2.26/api/mouse.zig | 69 +- official/release-3.2.26/api/opengl.zig | 2 + official/release-3.2.26/api/pen.zig | 28 + official/release-3.2.26/api/pixels.zig | 132 +- official/release-3.2.26/api/power.zig | 14 + official/release-3.2.26/api/process.zig | 52 + official/release-3.2.26/api/properties.zig | 3 +- official/release-3.2.26/api/rect.zig | 25 +- official/release-3.2.26/api/render.zig | 1085 +++----------- official/release-3.2.26/api/scancode.zig | 253 ++++ official/release-3.2.26/api/sensor.zig | 29 +- official/release-3.2.26/api/stdinc.zig | 3 + official/release-3.2.26/api/storage.zig | 97 +- official/release-3.2.26/api/surface.zig | 211 +-- official/release-3.2.26/api/system.zig | 29 +- official/release-3.2.26/api/time.zig | 15 +- official/release-3.2.26/api/timer.zig | 1 - official/release-3.2.26/api/touch.zig | 12 +- official/release-3.2.26/api/tray.zig | 116 ++ official/release-3.2.26/api/version.zig | 1 - official/release-3.2.26/api/video.zig | 254 ++-- official/release-3.2.26/json/audio.json | 12 + official/release-3.2.26/json/blendmode.json | 6 +- official/release-3.2.26/json/events.json | 64 +- official/release-3.2.26/json/filesystem.json | 9 +- official/release-3.2.26/json/gamepad.json | 16 + official/release-3.2.26/json/gpu.json | 6 +- official/release-3.2.26/json/guid.json | 51 + official/release-3.2.26/json/haptic.json | 8 + official/release-3.2.26/json/iostream.json | 737 ++++++++++ official/release-3.2.26/json/joystick.json | 12 + official/release-3.2.26/json/keyboard.json | 332 +++++ official/release-3.2.26/json/opengl.json | 12 + official/release-3.2.26/json/pen.json | 97 ++ official/release-3.2.26/json/pixels.json | 383 ++++- official/release-3.2.26/json/power.json | 58 + official/release-3.2.26/json/process.json | 153 ++ official/release-3.2.26/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.26/json/surface.json | 4 + official/release-3.2.26/json/system.json | 4 + official/release-3.2.26/json/touch.json | 4 + official/release-3.2.26/json/tray.json | 332 +++++ official/release-3.2.26/json/video.json | 3 +- official/release-3.2.28/api/audio.zig | 123 +- official/release-3.2.28/api/blendmode.zig | 7 +- official/release-3.2.28/api/c.zig | 1 + official/release-3.2.28/api/camera.zig | 81 +- official/release-3.2.28/api/clipboard.zig | 9 +- official/release-3.2.28/api/dialog.zig | 15 +- official/release-3.2.28/api/error.zig | 4 + official/release-3.2.28/api/events.zig | 226 +-- official/release-3.2.28/api/filesystem.zig | 17 +- official/release-3.2.28/api/gamepad.zig | 188 ++- official/release-3.2.28/api/gpu.zig | 241 ++-- official/release-3.2.28/api/guid.zig | 13 + official/release-3.2.28/api/haptic.zig | 79 +- official/release-3.2.28/api/hints.zig | 3 +- official/release-3.2.28/api/init.zig | 6 +- official/release-3.2.28/api/iostream.zig | 221 +++ official/release-3.2.28/api/joystick.zig | 155 +- official/release-3.2.28/api/keyboard.zig | 131 ++ official/release-3.2.28/api/keycode.zig | 1 - official/release-3.2.28/api/loadso.zig | 9 +- official/release-3.2.28/api/messagebox.zig | 16 +- official/release-3.2.28/api/misc.zig | 1 - official/release-3.2.28/api/mouse.zig | 69 +- official/release-3.2.28/api/opengl.zig | 2 + official/release-3.2.28/api/pen.zig | 28 + official/release-3.2.28/api/pixels.zig | 132 +- official/release-3.2.28/api/power.zig | 14 + official/release-3.2.28/api/process.zig | 52 + official/release-3.2.28/api/properties.zig | 3 +- official/release-3.2.28/api/rect.zig | 25 +- official/release-3.2.28/api/render.zig | 1085 +++----------- official/release-3.2.28/api/scancode.zig | 253 ++++ official/release-3.2.28/api/sensor.zig | 29 +- official/release-3.2.28/api/stdinc.zig | 3 + official/release-3.2.28/api/storage.zig | 97 +- official/release-3.2.28/api/surface.zig | 211 +-- official/release-3.2.28/api/system.zig | 29 +- official/release-3.2.28/api/time.zig | 15 +- official/release-3.2.28/api/timer.zig | 1 - official/release-3.2.28/api/touch.zig | 12 +- official/release-3.2.28/api/tray.zig | 116 ++ official/release-3.2.28/api/version.zig | 1 - official/release-3.2.28/api/video.zig | 254 ++-- official/release-3.2.28/json/audio.json | 12 + official/release-3.2.28/json/blendmode.json | 6 +- official/release-3.2.28/json/events.json | 64 +- official/release-3.2.28/json/filesystem.json | 9 +- official/release-3.2.28/json/gamepad.json | 16 + official/release-3.2.28/json/gpu.json | 6 +- official/release-3.2.28/json/guid.json | 51 + official/release-3.2.28/json/haptic.json | 8 + official/release-3.2.28/json/iostream.json | 737 ++++++++++ official/release-3.2.28/json/joystick.json | 12 + official/release-3.2.28/json/keyboard.json | 332 +++++ official/release-3.2.28/json/opengl.json | 12 + official/release-3.2.28/json/pen.json | 97 ++ official/release-3.2.28/json/pixels.json | 383 ++++- official/release-3.2.28/json/power.json | 58 + official/release-3.2.28/json/process.json | 153 ++ official/release-3.2.28/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.28/json/surface.json | 4 + official/release-3.2.28/json/system.json | 4 + official/release-3.2.28/json/touch.json | 4 + official/release-3.2.28/json/tray.json | 332 +++++ official/release-3.2.28/json/video.json | 3 +- official/release-3.2.30/api/audio.zig | 123 +- official/release-3.2.30/api/blendmode.zig | 7 +- official/release-3.2.30/api/c.zig | 1 + official/release-3.2.30/api/camera.zig | 81 +- official/release-3.2.30/api/clipboard.zig | 9 +- official/release-3.2.30/api/dialog.zig | 15 +- official/release-3.2.30/api/error.zig | 4 + official/release-3.2.30/api/events.zig | 226 +-- official/release-3.2.30/api/filesystem.zig | 17 +- official/release-3.2.30/api/gamepad.zig | 188 ++- official/release-3.2.30/api/gpu.zig | 241 ++-- official/release-3.2.30/api/guid.zig | 13 + official/release-3.2.30/api/haptic.zig | 79 +- official/release-3.2.30/api/hints.zig | 3 +- official/release-3.2.30/api/init.zig | 6 +- official/release-3.2.30/api/iostream.zig | 221 +++ official/release-3.2.30/api/joystick.zig | 155 +- official/release-3.2.30/api/keyboard.zig | 131 ++ official/release-3.2.30/api/keycode.zig | 1 - official/release-3.2.30/api/loadso.zig | 9 +- official/release-3.2.30/api/messagebox.zig | 16 +- official/release-3.2.30/api/misc.zig | 1 - official/release-3.2.30/api/mouse.zig | 69 +- official/release-3.2.30/api/opengl.zig | 2 + official/release-3.2.30/api/pen.zig | 28 + official/release-3.2.30/api/pixels.zig | 132 +- official/release-3.2.30/api/power.zig | 14 + official/release-3.2.30/api/process.zig | 52 + official/release-3.2.30/api/properties.zig | 3 +- official/release-3.2.30/api/rect.zig | 25 +- official/release-3.2.30/api/render.zig | 1085 +++----------- official/release-3.2.30/api/scancode.zig | 253 ++++ official/release-3.2.30/api/sensor.zig | 29 +- official/release-3.2.30/api/stdinc.zig | 3 + official/release-3.2.30/api/storage.zig | 97 +- official/release-3.2.30/api/surface.zig | 211 +-- official/release-3.2.30/api/system.zig | 29 +- official/release-3.2.30/api/time.zig | 15 +- official/release-3.2.30/api/timer.zig | 1 - official/release-3.2.30/api/touch.zig | 12 +- official/release-3.2.30/api/tray.zig | 116 ++ official/release-3.2.30/api/version.zig | 1 - official/release-3.2.30/api/video.zig | 254 ++-- official/release-3.2.30/json/audio.json | 12 + official/release-3.2.30/json/blendmode.json | 6 +- official/release-3.2.30/json/events.json | 64 +- official/release-3.2.30/json/filesystem.json | 9 +- official/release-3.2.30/json/gamepad.json | 16 + official/release-3.2.30/json/gpu.json | 6 +- official/release-3.2.30/json/guid.json | 51 + official/release-3.2.30/json/haptic.json | 8 + official/release-3.2.30/json/iostream.json | 737 ++++++++++ official/release-3.2.30/json/joystick.json | 12 + official/release-3.2.30/json/keyboard.json | 332 +++++ official/release-3.2.30/json/opengl.json | 12 + official/release-3.2.30/json/pen.json | 97 ++ official/release-3.2.30/json/pixels.json | 383 ++++- official/release-3.2.30/json/power.json | 58 + official/release-3.2.30/json/process.json | 153 ++ official/release-3.2.30/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.30/json/surface.json | 4 + official/release-3.2.30/json/system.json | 4 + official/release-3.2.30/json/touch.json | 4 + official/release-3.2.30/json/tray.json | 332 +++++ official/release-3.2.30/json/video.json | 3 +- official/release-3.2.4/api/audio.zig | 123 +- official/release-3.2.4/api/blendmode.zig | 7 +- official/release-3.2.4/api/c.zig | 1 + official/release-3.2.4/api/camera.zig | 80 +- official/release-3.2.4/api/clipboard.zig | 9 +- official/release-3.2.4/api/dialog.zig | 15 +- official/release-3.2.4/api/error.zig | 4 + official/release-3.2.4/api/events.zig | 226 +-- official/release-3.2.4/api/filesystem.zig | 17 +- official/release-3.2.4/api/gamepad.zig | 187 ++- official/release-3.2.4/api/gpu.zig | 241 ++-- official/release-3.2.4/api/guid.zig | 13 + official/release-3.2.4/api/haptic.zig | 79 +- official/release-3.2.4/api/hints.zig | 3 +- official/release-3.2.4/api/init.zig | 6 +- official/release-3.2.4/api/iostream.zig | 221 +++ official/release-3.2.4/api/joystick.zig | 154 +- official/release-3.2.4/api/keyboard.zig | 131 ++ official/release-3.2.4/api/keycode.zig | 1 - official/release-3.2.4/api/loadso.zig | 9 +- official/release-3.2.4/api/messagebox.zig | 16 +- official/release-3.2.4/api/misc.zig | 1 - official/release-3.2.4/api/mouse.zig | 69 +- official/release-3.2.4/api/opengl.zig | 2 + official/release-3.2.4/api/pen.zig | 28 + official/release-3.2.4/api/pixels.zig | 132 +- official/release-3.2.4/api/power.zig | 14 + official/release-3.2.4/api/process.zig | 52 + official/release-3.2.4/api/properties.zig | 3 +- official/release-3.2.4/api/rect.zig | 25 +- official/release-3.2.4/api/render.zig | 1082 +++----------- official/release-3.2.4/api/scancode.zig | 253 ++++ official/release-3.2.4/api/sensor.zig | 29 +- official/release-3.2.4/api/stdinc.zig | 3 + official/release-3.2.4/api/storage.zig | 97 +- official/release-3.2.4/api/surface.zig | 209 +-- official/release-3.2.4/api/system.zig | 29 +- official/release-3.2.4/api/time.zig | 15 +- official/release-3.2.4/api/timer.zig | 1 - official/release-3.2.4/api/touch.zig | 12 +- official/release-3.2.4/api/tray.zig | 116 ++ official/release-3.2.4/api/version.zig | 1 - official/release-3.2.4/api/video.zig | 253 ++-- official/release-3.2.4/json/audio.json | 12 + official/release-3.2.4/json/blendmode.json | 6 +- official/release-3.2.4/json/events.json | 64 +- official/release-3.2.4/json/filesystem.json | 9 +- official/release-3.2.4/json/gamepad.json | 16 + official/release-3.2.4/json/gpu.json | 6 +- official/release-3.2.4/json/guid.json | 51 + official/release-3.2.4/json/haptic.json | 8 + official/release-3.2.4/json/iostream.json | 737 ++++++++++ official/release-3.2.4/json/joystick.json | 12 + official/release-3.2.4/json/keyboard.json | 332 +++++ official/release-3.2.4/json/opengl.json | 12 + official/release-3.2.4/json/pen.json | 97 ++ official/release-3.2.4/json/pixels.json | 383 ++++- official/release-3.2.4/json/power.json | 58 + official/release-3.2.4/json/process.json | 153 ++ official/release-3.2.4/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.4/json/system.json | 4 + official/release-3.2.4/json/touch.json | 4 + official/release-3.2.4/json/tray.json | 332 +++++ official/release-3.2.4/json/video.json | 3 +- official/release-3.2.6/api/audio.zig | 123 +- official/release-3.2.6/api/blendmode.zig | 7 +- official/release-3.2.6/api/c.zig | 1 + official/release-3.2.6/api/camera.zig | 81 +- official/release-3.2.6/api/clipboard.zig | 9 +- official/release-3.2.6/api/dialog.zig | 15 +- official/release-3.2.6/api/error.zig | 4 + official/release-3.2.6/api/events.zig | 226 +-- official/release-3.2.6/api/filesystem.zig | 17 +- official/release-3.2.6/api/gamepad.zig | 187 ++- official/release-3.2.6/api/gpu.zig | 241 ++-- official/release-3.2.6/api/guid.zig | 13 + official/release-3.2.6/api/haptic.zig | 79 +- official/release-3.2.6/api/hints.zig | 3 +- official/release-3.2.6/api/init.zig | 6 +- official/release-3.2.6/api/iostream.zig | 221 +++ official/release-3.2.6/api/joystick.zig | 154 +- official/release-3.2.6/api/keyboard.zig | 131 ++ official/release-3.2.6/api/keycode.zig | 1 - official/release-3.2.6/api/loadso.zig | 9 +- official/release-3.2.6/api/messagebox.zig | 16 +- official/release-3.2.6/api/misc.zig | 1 - official/release-3.2.6/api/mouse.zig | 69 +- official/release-3.2.6/api/opengl.zig | 2 + official/release-3.2.6/api/pen.zig | 28 + official/release-3.2.6/api/pixels.zig | 132 +- official/release-3.2.6/api/power.zig | 14 + official/release-3.2.6/api/process.zig | 52 + official/release-3.2.6/api/properties.zig | 3 +- official/release-3.2.6/api/rect.zig | 25 +- official/release-3.2.6/api/render.zig | 1083 +++----------- official/release-3.2.6/api/scancode.zig | 253 ++++ official/release-3.2.6/api/sensor.zig | 29 +- official/release-3.2.6/api/stdinc.zig | 3 + official/release-3.2.6/api/storage.zig | 97 +- official/release-3.2.6/api/surface.zig | 210 +-- official/release-3.2.6/api/system.zig | 29 +- official/release-3.2.6/api/time.zig | 15 +- official/release-3.2.6/api/timer.zig | 1 - official/release-3.2.6/api/touch.zig | 12 +- official/release-3.2.6/api/tray.zig | 116 ++ official/release-3.2.6/api/version.zig | 1 - official/release-3.2.6/api/video.zig | 254 ++-- official/release-3.2.6/json/audio.json | 12 + official/release-3.2.6/json/blendmode.json | 6 +- official/release-3.2.6/json/events.json | 64 +- official/release-3.2.6/json/filesystem.json | 9 +- official/release-3.2.6/json/gamepad.json | 16 + official/release-3.2.6/json/gpu.json | 6 +- official/release-3.2.6/json/guid.json | 51 + official/release-3.2.6/json/haptic.json | 8 + official/release-3.2.6/json/iostream.json | 737 ++++++++++ official/release-3.2.6/json/joystick.json | 12 + official/release-3.2.6/json/keyboard.json | 332 +++++ official/release-3.2.6/json/opengl.json | 12 + official/release-3.2.6/json/pen.json | 97 ++ official/release-3.2.6/json/pixels.json | 383 ++++- official/release-3.2.6/json/power.json | 58 + official/release-3.2.6/json/process.json | 153 ++ official/release-3.2.6/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.6/json/system.json | 4 + official/release-3.2.6/json/touch.json | 4 + official/release-3.2.6/json/tray.json | 332 +++++ official/release-3.2.6/json/video.json | 3 +- official/release-3.2.8/api/audio.zig | 123 +- official/release-3.2.8/api/blendmode.zig | 7 +- official/release-3.2.8/api/c.zig | 1 + official/release-3.2.8/api/camera.zig | 81 +- official/release-3.2.8/api/clipboard.zig | 9 +- official/release-3.2.8/api/dialog.zig | 15 +- official/release-3.2.8/api/error.zig | 4 + official/release-3.2.8/api/events.zig | 226 +-- official/release-3.2.8/api/filesystem.zig | 17 +- official/release-3.2.8/api/gamepad.zig | 187 ++- official/release-3.2.8/api/gpu.zig | 241 ++-- official/release-3.2.8/api/guid.zig | 13 + official/release-3.2.8/api/haptic.zig | 79 +- official/release-3.2.8/api/hints.zig | 3 +- official/release-3.2.8/api/init.zig | 6 +- official/release-3.2.8/api/iostream.zig | 221 +++ official/release-3.2.8/api/joystick.zig | 154 +- official/release-3.2.8/api/keyboard.zig | 131 ++ official/release-3.2.8/api/keycode.zig | 1 - official/release-3.2.8/api/loadso.zig | 9 +- official/release-3.2.8/api/messagebox.zig | 16 +- official/release-3.2.8/api/misc.zig | 1 - official/release-3.2.8/api/mouse.zig | 69 +- official/release-3.2.8/api/opengl.zig | 2 + official/release-3.2.8/api/pen.zig | 28 + official/release-3.2.8/api/pixels.zig | 132 +- official/release-3.2.8/api/power.zig | 14 + official/release-3.2.8/api/process.zig | 52 + official/release-3.2.8/api/properties.zig | 3 +- official/release-3.2.8/api/rect.zig | 25 +- official/release-3.2.8/api/render.zig | 1083 +++----------- official/release-3.2.8/api/scancode.zig | 253 ++++ official/release-3.2.8/api/sensor.zig | 29 +- official/release-3.2.8/api/stdinc.zig | 3 + official/release-3.2.8/api/storage.zig | 97 +- official/release-3.2.8/api/surface.zig | 210 +-- official/release-3.2.8/api/system.zig | 29 +- official/release-3.2.8/api/time.zig | 15 +- official/release-3.2.8/api/timer.zig | 1 - official/release-3.2.8/api/touch.zig | 12 +- official/release-3.2.8/api/tray.zig | 116 ++ official/release-3.2.8/api/version.zig | 1 - official/release-3.2.8/api/video.zig | 254 ++-- official/release-3.2.8/json/audio.json | 12 + official/release-3.2.8/json/blendmode.json | 6 +- official/release-3.2.8/json/events.json | 64 +- official/release-3.2.8/json/filesystem.json | 9 +- official/release-3.2.8/json/gamepad.json | 16 + official/release-3.2.8/json/gpu.json | 6 +- official/release-3.2.8/json/guid.json | 51 + official/release-3.2.8/json/haptic.json | 8 + official/release-3.2.8/json/iostream.json | 737 ++++++++++ official/release-3.2.8/json/joystick.json | 12 + official/release-3.2.8/json/keyboard.json | 332 +++++ official/release-3.2.8/json/opengl.json | 12 + official/release-3.2.8/json/pen.json | 97 ++ official/release-3.2.8/json/pixels.json | 383 ++++- official/release-3.2.8/json/power.json | 58 + official/release-3.2.8/json/process.json | 153 ++ official/release-3.2.8/json/scancode.json | 1083 ++++++++++++++ official/release-3.2.8/json/system.json | 4 + official/release-3.2.8/json/touch.json | 4 + official/release-3.2.8/json/tray.json | 332 +++++ official/release-3.2.8/json/video.json | 3 +- official/release-3.4.0/api/audio.zig | 172 +-- official/release-3.4.0/api/blendmode.zig | 33 +- official/release-3.4.0/api/c.zig | 1 + official/release-3.4.0/api/camera.zig | 83 +- official/release-3.4.0/api/clipboard.zig | 23 +- official/release-3.4.0/api/dialog.zig | 19 +- official/release-3.4.0/api/error.zig | 8 +- official/release-3.4.0/api/events.zig | 273 ++-- official/release-3.4.0/api/filesystem.zig | 29 +- official/release-3.4.0/api/gamepad.zig | 200 ++- official/release-3.4.0/api/gpu.zig | 331 +++-- official/release-3.4.0/api/guid.zig | 13 + official/release-3.4.0/api/haptic.zig | 87 +- official/release-3.4.0/api/hints.zig | 11 +- official/release-3.4.0/api/init.zig | 20 +- official/release-3.4.0/api/iostream.zig | 221 +++ official/release-3.4.0/api/joystick.zig | 167 +-- official/release-3.4.0/api/keyboard.zig | 131 ++ official/release-3.4.0/api/keycode.zig | 1 - official/release-3.4.0/api/loadso.zig | 9 +- official/release-3.4.0/api/messagebox.zig | 20 +- official/release-3.4.0/api/misc.zig | 3 +- official/release-3.4.0/api/mouse.zig | 89 +- official/release-3.4.0/api/opengl.zig | 2 + official/release-3.4.0/api/pen.zig | 39 + official/release-3.4.0/api/pixels.zig | 263 ++-- official/release-3.4.0/api/power.zig | 14 + official/release-3.4.0/api/process.zig | 52 + official/release-3.4.0/api/properties.zig | 27 +- official/release-3.4.0/api/rect.zig | 41 +- official/release-3.4.0/api/render.zig | 1218 ++++------------ official/release-3.4.0/api/scancode.zig | 253 ++++ official/release-3.4.0/api/sensor.zig | 31 +- official/release-3.4.0/api/stdinc.zig | 3 + official/release-3.4.0/api/storage.zig | 97 +- official/release-3.4.0/api/surface.zig | 274 ++-- official/release-3.4.0/api/system.zig | 49 +- official/release-3.4.0/api/time.zig | 27 +- official/release-3.4.0/api/timer.zig | 3 +- official/release-3.4.0/api/touch.zig | 12 +- official/release-3.4.0/api/tray.zig | 116 ++ official/release-3.4.0/api/version.zig | 1 - official/release-3.4.0/api/video.zig | 298 ++-- official/release-3.4.0/json/audio.json | 12 + official/release-3.4.0/json/blendmode.json | 6 +- official/release-3.4.0/json/camera.json | 4 + official/release-3.4.0/json/events.json | 67 +- official/release-3.4.0/json/filesystem.json | 9 +- official/release-3.4.0/json/gamepad.json | 16 + official/release-3.4.0/json/gpu.json | 49 +- official/release-3.4.0/json/guid.json | 51 + official/release-3.4.0/json/haptic.json | 8 + official/release-3.4.0/json/init.json | 16 +- official/release-3.4.0/json/iostream.json | 737 ++++++++++ official/release-3.4.0/json/joystick.json | 12 + official/release-3.4.0/json/keyboard.json | 332 +++++ official/release-3.4.0/json/messagebox.json | 14 +- official/release-3.4.0/json/mouse.json | 14 +- official/release-3.4.0/json/opengl.json | 12 + official/release-3.4.0/json/pen.json | 135 ++ official/release-3.4.0/json/pixels.json | 383 ++++- official/release-3.4.0/json/power.json | 58 + official/release-3.4.0/json/process.json | 153 ++ official/release-3.4.0/json/render.json | 4 + official/release-3.4.0/json/scancode.json | 1083 ++++++++++++++ official/release-3.4.0/json/surface.json | 15 +- official/release-3.4.0/json/system.json | 4 + official/release-3.4.0/json/touch.json | 4 + official/release-3.4.0/json/tray.json | 332 +++++ official/release-3.4.0/json/video.json | 55 +- 2278 files changed, 186717 insertions(+), 74267 deletions(-) create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/c.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/guid.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/iostream.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/keyboard.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/opengl.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/pen.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/power.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/process.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/scancode.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/api/stdinc.zig delete mode 100644 castholm/v0.1.0-SDL-3.1.6/debug/error_SDL_touch_h.zig create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/guid.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/iostream.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/keyboard.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/opengl.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/pen.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/power.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/process.json create mode 100644 castholm/v0.1.0-SDL-3.1.6/json/scancode.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/c.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/guid.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/iostream.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/keyboard.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/opengl.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/pen.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/power.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/process.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/scancode.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/stdinc.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/api/tray.zig create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/guid.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/iostream.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/keyboard.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/opengl.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/pen.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/power.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/process.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/scancode.json create mode 100644 castholm/v0.1.1-SDL-3.1.8/json/tray.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/c.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/guid.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/iostream.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/keyboard.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/opengl.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/pen.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/power.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/process.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/scancode.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/stdinc.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/api/tray.zig create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/guid.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/iostream.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/keyboard.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/opengl.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/pen.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/power.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/process.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/scancode.json create mode 100644 castholm/v0.1.2-SDL-3.1.10/json/tray.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/c.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/guid.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/iostream.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/keyboard.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/opengl.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/pen.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/power.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/process.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/scancode.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/stdinc.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/api/tray.zig create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/guid.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/iostream.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/keyboard.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/opengl.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/pen.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/power.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/process.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/scancode.json create mode 100644 castholm/v0.1.3-SDL-3.2.0/json/tray.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/c.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/guid.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/iostream.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/keyboard.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/opengl.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/pen.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/power.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/process.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/scancode.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/stdinc.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/api/tray.zig create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/guid.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/iostream.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/keyboard.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/opengl.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/pen.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/power.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/process.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/scancode.json create mode 100644 castholm/v0.1.4-SDL-3.2.2/json/tray.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/c.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/guid.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/iostream.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/keyboard.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/opengl.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/pen.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/power.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/process.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/scancode.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/stdinc.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/api/tray.zig create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/guid.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/iostream.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/keyboard.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/opengl.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/pen.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/power.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/process.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/scancode.json create mode 100644 castholm/v0.1.5-SDL-3.2.4/json/tray.json create mode 100644 castholm/v0.2.0-3.2.8/api/c.zig create mode 100644 castholm/v0.2.0-3.2.8/api/guid.zig create mode 100644 castholm/v0.2.0-3.2.8/api/iostream.zig create mode 100644 castholm/v0.2.0-3.2.8/api/keyboard.zig create mode 100644 castholm/v0.2.0-3.2.8/api/opengl.zig create mode 100644 castholm/v0.2.0-3.2.8/api/pen.zig create mode 100644 castholm/v0.2.0-3.2.8/api/power.zig create mode 100644 castholm/v0.2.0-3.2.8/api/process.zig create mode 100644 castholm/v0.2.0-3.2.8/api/scancode.zig create mode 100644 castholm/v0.2.0-3.2.8/api/stdinc.zig create mode 100644 castholm/v0.2.0-3.2.8/api/tray.zig create mode 100644 castholm/v0.2.0-3.2.8/json/guid.json create mode 100644 castholm/v0.2.0-3.2.8/json/iostream.json create mode 100644 castholm/v0.2.0-3.2.8/json/keyboard.json create mode 100644 castholm/v0.2.0-3.2.8/json/opengl.json create mode 100644 castholm/v0.2.0-3.2.8/json/pen.json create mode 100644 castholm/v0.2.0-3.2.8/json/power.json create mode 100644 castholm/v0.2.0-3.2.8/json/process.json create mode 100644 castholm/v0.2.0-3.2.8/json/scancode.json create mode 100644 castholm/v0.2.0-3.2.8/json/tray.json create mode 100644 castholm/v0.2.1-3.2.10/api/c.zig create mode 100644 castholm/v0.2.1-3.2.10/api/guid.zig create mode 100644 castholm/v0.2.1-3.2.10/api/iostream.zig create mode 100644 castholm/v0.2.1-3.2.10/api/keyboard.zig create mode 100644 castholm/v0.2.1-3.2.10/api/opengl.zig create mode 100644 castholm/v0.2.1-3.2.10/api/pen.zig create mode 100644 castholm/v0.2.1-3.2.10/api/power.zig create mode 100644 castholm/v0.2.1-3.2.10/api/process.zig create mode 100644 castholm/v0.2.1-3.2.10/api/scancode.zig create mode 100644 castholm/v0.2.1-3.2.10/api/stdinc.zig create mode 100644 castholm/v0.2.1-3.2.10/api/tray.zig create mode 100644 castholm/v0.2.1-3.2.10/json/guid.json create mode 100644 castholm/v0.2.1-3.2.10/json/iostream.json create mode 100644 castholm/v0.2.1-3.2.10/json/keyboard.json create mode 100644 castholm/v0.2.1-3.2.10/json/opengl.json create mode 100644 castholm/v0.2.1-3.2.10/json/pen.json create mode 100644 castholm/v0.2.1-3.2.10/json/power.json create mode 100644 castholm/v0.2.1-3.2.10/json/process.json create mode 100644 castholm/v0.2.1-3.2.10/json/scancode.json create mode 100644 castholm/v0.2.1-3.2.10/json/tray.json create mode 100644 castholm/v0.2.2-3.2.12/api/c.zig create mode 100644 castholm/v0.2.2-3.2.12/api/guid.zig create mode 100644 castholm/v0.2.2-3.2.12/api/iostream.zig create mode 100644 castholm/v0.2.2-3.2.12/api/keyboard.zig create mode 100644 castholm/v0.2.2-3.2.12/api/opengl.zig create mode 100644 castholm/v0.2.2-3.2.12/api/pen.zig create mode 100644 castholm/v0.2.2-3.2.12/api/power.zig create mode 100644 castholm/v0.2.2-3.2.12/api/process.zig create mode 100644 castholm/v0.2.2-3.2.12/api/scancode.zig create mode 100644 castholm/v0.2.2-3.2.12/api/stdinc.zig create mode 100644 castholm/v0.2.2-3.2.12/api/tray.zig create mode 100644 castholm/v0.2.2-3.2.12/json/guid.json create mode 100644 castholm/v0.2.2-3.2.12/json/iostream.json create mode 100644 castholm/v0.2.2-3.2.12/json/keyboard.json create mode 100644 castholm/v0.2.2-3.2.12/json/opengl.json create mode 100644 castholm/v0.2.2-3.2.12/json/pen.json create mode 100644 castholm/v0.2.2-3.2.12/json/power.json create mode 100644 castholm/v0.2.2-3.2.12/json/process.json create mode 100644 castholm/v0.2.2-3.2.12/json/scancode.json create mode 100644 castholm/v0.2.2-3.2.12/json/tray.json create mode 100644 castholm/v0.2.3-3.2.14/api/c.zig create mode 100644 castholm/v0.2.3-3.2.14/api/guid.zig create mode 100644 castholm/v0.2.3-3.2.14/api/iostream.zig create mode 100644 castholm/v0.2.3-3.2.14/api/keyboard.zig create mode 100644 castholm/v0.2.3-3.2.14/api/opengl.zig create mode 100644 castholm/v0.2.3-3.2.14/api/pen.zig create mode 100644 castholm/v0.2.3-3.2.14/api/power.zig create mode 100644 castholm/v0.2.3-3.2.14/api/process.zig create mode 100644 castholm/v0.2.3-3.2.14/api/scancode.zig create mode 100644 castholm/v0.2.3-3.2.14/api/stdinc.zig create mode 100644 castholm/v0.2.3-3.2.14/api/tray.zig create mode 100644 castholm/v0.2.3-3.2.14/json/guid.json create mode 100644 castholm/v0.2.3-3.2.14/json/iostream.json create mode 100644 castholm/v0.2.3-3.2.14/json/keyboard.json create mode 100644 castholm/v0.2.3-3.2.14/json/opengl.json create mode 100644 castholm/v0.2.3-3.2.14/json/pen.json create mode 100644 castholm/v0.2.3-3.2.14/json/power.json create mode 100644 castholm/v0.2.3-3.2.14/json/process.json create mode 100644 castholm/v0.2.3-3.2.14/json/scancode.json create mode 100644 castholm/v0.2.3-3.2.14/json/tray.json create mode 100644 castholm/v0.2.4-3.2.16/api/c.zig create mode 100644 castholm/v0.2.4-3.2.16/api/guid.zig create mode 100644 castholm/v0.2.4-3.2.16/api/iostream.zig create mode 100644 castholm/v0.2.4-3.2.16/api/keyboard.zig create mode 100644 castholm/v0.2.4-3.2.16/api/opengl.zig create mode 100644 castholm/v0.2.4-3.2.16/api/pen.zig create mode 100644 castholm/v0.2.4-3.2.16/api/power.zig create mode 100644 castholm/v0.2.4-3.2.16/api/process.zig create mode 100644 castholm/v0.2.4-3.2.16/api/scancode.zig create mode 100644 castholm/v0.2.4-3.2.16/api/stdinc.zig create mode 100644 castholm/v0.2.4-3.2.16/api/tray.zig create mode 100644 castholm/v0.2.4-3.2.16/json/guid.json create mode 100644 castholm/v0.2.4-3.2.16/json/iostream.json create mode 100644 castholm/v0.2.4-3.2.16/json/keyboard.json create mode 100644 castholm/v0.2.4-3.2.16/json/opengl.json create mode 100644 castholm/v0.2.4-3.2.16/json/pen.json create mode 100644 castholm/v0.2.4-3.2.16/json/power.json create mode 100644 castholm/v0.2.4-3.2.16/json/process.json create mode 100644 castholm/v0.2.4-3.2.16/json/scancode.json create mode 100644 castholm/v0.2.4-3.2.16/json/tray.json create mode 100644 castholm/v0.2.5-3.2.18/api/c.zig create mode 100644 castholm/v0.2.5-3.2.18/api/guid.zig create mode 100644 castholm/v0.2.5-3.2.18/api/iostream.zig create mode 100644 castholm/v0.2.5-3.2.18/api/keyboard.zig create mode 100644 castholm/v0.2.5-3.2.18/api/opengl.zig create mode 100644 castholm/v0.2.5-3.2.18/api/pen.zig create mode 100644 castholm/v0.2.5-3.2.18/api/power.zig create mode 100644 castholm/v0.2.5-3.2.18/api/process.zig create mode 100644 castholm/v0.2.5-3.2.18/api/scancode.zig create mode 100644 castholm/v0.2.5-3.2.18/api/stdinc.zig create mode 100644 castholm/v0.2.5-3.2.18/api/tray.zig create mode 100644 castholm/v0.2.5-3.2.18/json/guid.json create mode 100644 castholm/v0.2.5-3.2.18/json/iostream.json create mode 100644 castholm/v0.2.5-3.2.18/json/keyboard.json create mode 100644 castholm/v0.2.5-3.2.18/json/opengl.json create mode 100644 castholm/v0.2.5-3.2.18/json/pen.json create mode 100644 castholm/v0.2.5-3.2.18/json/power.json create mode 100644 castholm/v0.2.5-3.2.18/json/process.json create mode 100644 castholm/v0.2.5-3.2.18/json/scancode.json create mode 100644 castholm/v0.2.5-3.2.18/json/tray.json create mode 100644 castholm/v0.2.6-3.2.20/api/c.zig create mode 100644 castholm/v0.2.6-3.2.20/api/guid.zig create mode 100644 castholm/v0.2.6-3.2.20/api/iostream.zig create mode 100644 castholm/v0.2.6-3.2.20/api/keyboard.zig create mode 100644 castholm/v0.2.6-3.2.20/api/opengl.zig create mode 100644 castholm/v0.2.6-3.2.20/api/pen.zig create mode 100644 castholm/v0.2.6-3.2.20/api/power.zig create mode 100644 castholm/v0.2.6-3.2.20/api/process.zig create mode 100644 castholm/v0.2.6-3.2.20/api/scancode.zig create mode 100644 castholm/v0.2.6-3.2.20/api/stdinc.zig create mode 100644 castholm/v0.2.6-3.2.20/api/tray.zig create mode 100644 castholm/v0.2.6-3.2.20/json/guid.json create mode 100644 castholm/v0.2.6-3.2.20/json/iostream.json create mode 100644 castholm/v0.2.6-3.2.20/json/keyboard.json create mode 100644 castholm/v0.2.6-3.2.20/json/opengl.json create mode 100644 castholm/v0.2.6-3.2.20/json/pen.json create mode 100644 castholm/v0.2.6-3.2.20/json/power.json create mode 100644 castholm/v0.2.6-3.2.20/json/process.json create mode 100644 castholm/v0.2.6-3.2.20/json/scancode.json create mode 100644 castholm/v0.2.6-3.2.20/json/tray.json create mode 100644 castholm/v0.3.0-3.2.22/api/c.zig create mode 100644 castholm/v0.3.0-3.2.22/api/guid.zig create mode 100644 castholm/v0.3.0-3.2.22/api/iostream.zig create mode 100644 castholm/v0.3.0-3.2.22/api/keyboard.zig create mode 100644 castholm/v0.3.0-3.2.22/api/opengl.zig create mode 100644 castholm/v0.3.0-3.2.22/api/pen.zig create mode 100644 castholm/v0.3.0-3.2.22/api/power.zig create mode 100644 castholm/v0.3.0-3.2.22/api/process.zig create mode 100644 castholm/v0.3.0-3.2.22/api/scancode.zig create mode 100644 castholm/v0.3.0-3.2.22/api/stdinc.zig create mode 100644 castholm/v0.3.0-3.2.22/api/tray.zig create mode 100644 castholm/v0.3.0-3.2.22/json/guid.json create mode 100644 castholm/v0.3.0-3.2.22/json/iostream.json create mode 100644 castholm/v0.3.0-3.2.22/json/keyboard.json create mode 100644 castholm/v0.3.0-3.2.22/json/opengl.json create mode 100644 castholm/v0.3.0-3.2.22/json/pen.json create mode 100644 castholm/v0.3.0-3.2.22/json/power.json create mode 100644 castholm/v0.3.0-3.2.22/json/process.json create mode 100644 castholm/v0.3.0-3.2.22/json/scancode.json create mode 100644 castholm/v0.3.0-3.2.22/json/tray.json create mode 100644 castholm/v0.3.1-3.2.24/api/c.zig create mode 100644 castholm/v0.3.1-3.2.24/api/guid.zig create mode 100644 castholm/v0.3.1-3.2.24/api/iostream.zig create mode 100644 castholm/v0.3.1-3.2.24/api/keyboard.zig create mode 100644 castholm/v0.3.1-3.2.24/api/opengl.zig create mode 100644 castholm/v0.3.1-3.2.24/api/pen.zig create mode 100644 castholm/v0.3.1-3.2.24/api/power.zig create mode 100644 castholm/v0.3.1-3.2.24/api/process.zig create mode 100644 castholm/v0.3.1-3.2.24/api/scancode.zig create mode 100644 castholm/v0.3.1-3.2.24/api/stdinc.zig create mode 100644 castholm/v0.3.1-3.2.24/api/tray.zig create mode 100644 castholm/v0.3.1-3.2.24/json/guid.json create mode 100644 castholm/v0.3.1-3.2.24/json/iostream.json create mode 100644 castholm/v0.3.1-3.2.24/json/keyboard.json create mode 100644 castholm/v0.3.1-3.2.24/json/opengl.json create mode 100644 castholm/v0.3.1-3.2.24/json/pen.json create mode 100644 castholm/v0.3.1-3.2.24/json/power.json create mode 100644 castholm/v0.3.1-3.2.24/json/process.json create mode 100644 castholm/v0.3.1-3.2.24/json/scancode.json create mode 100644 castholm/v0.3.1-3.2.24/json/tray.json create mode 100644 castholm/v0.3.2-3.2.26/api/c.zig create mode 100644 castholm/v0.3.2-3.2.26/api/guid.zig create mode 100644 castholm/v0.3.2-3.2.26/api/iostream.zig create mode 100644 castholm/v0.3.2-3.2.26/api/keyboard.zig create mode 100644 castholm/v0.3.2-3.2.26/api/opengl.zig create mode 100644 castholm/v0.3.2-3.2.26/api/pen.zig create mode 100644 castholm/v0.3.2-3.2.26/api/power.zig create mode 100644 castholm/v0.3.2-3.2.26/api/process.zig create mode 100644 castholm/v0.3.2-3.2.26/api/scancode.zig create mode 100644 castholm/v0.3.2-3.2.26/api/stdinc.zig create mode 100644 castholm/v0.3.2-3.2.26/api/tray.zig create mode 100644 castholm/v0.3.2-3.2.26/json/guid.json create mode 100644 castholm/v0.3.2-3.2.26/json/iostream.json create mode 100644 castholm/v0.3.2-3.2.26/json/keyboard.json create mode 100644 castholm/v0.3.2-3.2.26/json/opengl.json create mode 100644 castholm/v0.3.2-3.2.26/json/pen.json create mode 100644 castholm/v0.3.2-3.2.26/json/power.json create mode 100644 castholm/v0.3.2-3.2.26/json/process.json create mode 100644 castholm/v0.3.2-3.2.26/json/scancode.json create mode 100644 castholm/v0.3.2-3.2.26/json/tray.json create mode 100644 castholm/v0.3.3-3.2.28/api/c.zig create mode 100644 castholm/v0.3.3-3.2.28/api/guid.zig create mode 100644 castholm/v0.3.3-3.2.28/api/iostream.zig create mode 100644 castholm/v0.3.3-3.2.28/api/keyboard.zig create mode 100644 castholm/v0.3.3-3.2.28/api/opengl.zig create mode 100644 castholm/v0.3.3-3.2.28/api/pen.zig create mode 100644 castholm/v0.3.3-3.2.28/api/power.zig create mode 100644 castholm/v0.3.3-3.2.28/api/process.zig create mode 100644 castholm/v0.3.3-3.2.28/api/scancode.zig create mode 100644 castholm/v0.3.3-3.2.28/api/stdinc.zig create mode 100644 castholm/v0.3.3-3.2.28/api/tray.zig create mode 100644 castholm/v0.3.3-3.2.28/json/guid.json create mode 100644 castholm/v0.3.3-3.2.28/json/iostream.json create mode 100644 castholm/v0.3.3-3.2.28/json/keyboard.json create mode 100644 castholm/v0.3.3-3.2.28/json/opengl.json create mode 100644 castholm/v0.3.3-3.2.28/json/pen.json create mode 100644 castholm/v0.3.3-3.2.28/json/power.json create mode 100644 castholm/v0.3.3-3.2.28/json/process.json create mode 100644 castholm/v0.3.3-3.2.28/json/scancode.json create mode 100644 castholm/v0.3.3-3.2.28/json/tray.json create mode 100644 castholm/v0.4.0-3.4.0/api/c.zig create mode 100644 castholm/v0.4.0-3.4.0/api/camera.zig rename castholm/v0.4.0-3.4.0/{debug/SDL_gpu_h_fmterror.zig => api/gpu.zig} (72%) create mode 100644 castholm/v0.4.0-3.4.0/api/guid.zig create mode 100644 castholm/v0.4.0-3.4.0/api/iostream.zig create mode 100644 castholm/v0.4.0-3.4.0/api/keyboard.zig create mode 100644 castholm/v0.4.0-3.4.0/api/opengl.zig create mode 100644 castholm/v0.4.0-3.4.0/api/pen.zig create mode 100644 castholm/v0.4.0-3.4.0/api/pixels.zig create mode 100644 castholm/v0.4.0-3.4.0/api/power.zig create mode 100644 castholm/v0.4.0-3.4.0/api/process.zig create mode 100644 castholm/v0.4.0-3.4.0/api/render.zig create mode 100644 castholm/v0.4.0-3.4.0/api/scancode.zig create mode 100644 castholm/v0.4.0-3.4.0/api/stdinc.zig create mode 100644 castholm/v0.4.0-3.4.0/api/surface.zig create mode 100644 castholm/v0.4.0-3.4.0/api/tray.zig create mode 100644 castholm/v0.4.0-3.4.0/api/video.zig delete mode 100644 castholm/v0.4.0-3.4.0/debug/SDL_camera_h_fmterror.zig delete mode 100644 castholm/v0.4.0-3.4.0/debug/SDL_pixels_h_fmterror.zig delete mode 100644 castholm/v0.4.0-3.4.0/debug/SDL_render_h_fmterror.zig delete mode 100644 castholm/v0.4.0-3.4.0/debug/SDL_surface_h_fmterror.zig delete mode 100644 castholm/v0.4.0-3.4.0/debug/error_SDL_audio_h.zig create mode 100644 castholm/v0.4.0-3.4.0/json/guid.json create mode 100644 castholm/v0.4.0-3.4.0/json/iostream.json create mode 100644 castholm/v0.4.0-3.4.0/json/keyboard.json create mode 100644 castholm/v0.4.0-3.4.0/json/opengl.json create mode 100644 castholm/v0.4.0-3.4.0/json/pen.json create mode 100644 castholm/v0.4.0-3.4.0/json/power.json create mode 100644 castholm/v0.4.0-3.4.0/json/process.json create mode 100644 castholm/v0.4.0-3.4.0/json/scancode.json create mode 100644 castholm/v0.4.0-3.4.0/json/tray.json create mode 100644 official/release-3.2.0/api/c.zig create mode 100644 official/release-3.2.0/api/guid.zig create mode 100644 official/release-3.2.0/api/iostream.zig create mode 100644 official/release-3.2.0/api/keyboard.zig create mode 100644 official/release-3.2.0/api/opengl.zig create mode 100644 official/release-3.2.0/api/pen.zig create mode 100644 official/release-3.2.0/api/power.zig create mode 100644 official/release-3.2.0/api/process.zig create mode 100644 official/release-3.2.0/api/scancode.zig create mode 100644 official/release-3.2.0/api/stdinc.zig create mode 100644 official/release-3.2.0/api/tray.zig create mode 100644 official/release-3.2.0/json/guid.json create mode 100644 official/release-3.2.0/json/iostream.json create mode 100644 official/release-3.2.0/json/keyboard.json create mode 100644 official/release-3.2.0/json/opengl.json create mode 100644 official/release-3.2.0/json/pen.json create mode 100644 official/release-3.2.0/json/power.json create mode 100644 official/release-3.2.0/json/process.json create mode 100644 official/release-3.2.0/json/scancode.json create mode 100644 official/release-3.2.0/json/tray.json create mode 100644 official/release-3.2.10/api/c.zig create mode 100644 official/release-3.2.10/api/guid.zig create mode 100644 official/release-3.2.10/api/iostream.zig create mode 100644 official/release-3.2.10/api/keyboard.zig create mode 100644 official/release-3.2.10/api/opengl.zig create mode 100644 official/release-3.2.10/api/pen.zig create mode 100644 official/release-3.2.10/api/power.zig create mode 100644 official/release-3.2.10/api/process.zig create mode 100644 official/release-3.2.10/api/scancode.zig create mode 100644 official/release-3.2.10/api/stdinc.zig create mode 100644 official/release-3.2.10/api/tray.zig create mode 100644 official/release-3.2.10/json/guid.json create mode 100644 official/release-3.2.10/json/iostream.json create mode 100644 official/release-3.2.10/json/keyboard.json create mode 100644 official/release-3.2.10/json/opengl.json create mode 100644 official/release-3.2.10/json/pen.json create mode 100644 official/release-3.2.10/json/power.json create mode 100644 official/release-3.2.10/json/process.json create mode 100644 official/release-3.2.10/json/scancode.json create mode 100644 official/release-3.2.10/json/tray.json create mode 100644 official/release-3.2.12/api/c.zig create mode 100644 official/release-3.2.12/api/guid.zig create mode 100644 official/release-3.2.12/api/iostream.zig create mode 100644 official/release-3.2.12/api/keyboard.zig create mode 100644 official/release-3.2.12/api/opengl.zig create mode 100644 official/release-3.2.12/api/pen.zig create mode 100644 official/release-3.2.12/api/power.zig create mode 100644 official/release-3.2.12/api/process.zig create mode 100644 official/release-3.2.12/api/scancode.zig create mode 100644 official/release-3.2.12/api/stdinc.zig create mode 100644 official/release-3.2.12/api/tray.zig create mode 100644 official/release-3.2.12/json/guid.json create mode 100644 official/release-3.2.12/json/iostream.json create mode 100644 official/release-3.2.12/json/keyboard.json create mode 100644 official/release-3.2.12/json/opengl.json create mode 100644 official/release-3.2.12/json/pen.json create mode 100644 official/release-3.2.12/json/power.json create mode 100644 official/release-3.2.12/json/process.json create mode 100644 official/release-3.2.12/json/scancode.json create mode 100644 official/release-3.2.12/json/tray.json create mode 100644 official/release-3.2.14/api/c.zig create mode 100644 official/release-3.2.14/api/guid.zig create mode 100644 official/release-3.2.14/api/iostream.zig create mode 100644 official/release-3.2.14/api/keyboard.zig create mode 100644 official/release-3.2.14/api/opengl.zig create mode 100644 official/release-3.2.14/api/pen.zig create mode 100644 official/release-3.2.14/api/power.zig create mode 100644 official/release-3.2.14/api/process.zig create mode 100644 official/release-3.2.14/api/scancode.zig create mode 100644 official/release-3.2.14/api/stdinc.zig create mode 100644 official/release-3.2.14/api/tray.zig create mode 100644 official/release-3.2.14/json/guid.json create mode 100644 official/release-3.2.14/json/iostream.json create mode 100644 official/release-3.2.14/json/keyboard.json create mode 100644 official/release-3.2.14/json/opengl.json create mode 100644 official/release-3.2.14/json/pen.json create mode 100644 official/release-3.2.14/json/power.json create mode 100644 official/release-3.2.14/json/process.json create mode 100644 official/release-3.2.14/json/scancode.json create mode 100644 official/release-3.2.14/json/tray.json create mode 100644 official/release-3.2.16/api/c.zig create mode 100644 official/release-3.2.16/api/guid.zig create mode 100644 official/release-3.2.16/api/iostream.zig create mode 100644 official/release-3.2.16/api/keyboard.zig create mode 100644 official/release-3.2.16/api/opengl.zig create mode 100644 official/release-3.2.16/api/pen.zig create mode 100644 official/release-3.2.16/api/power.zig create mode 100644 official/release-3.2.16/api/process.zig create mode 100644 official/release-3.2.16/api/scancode.zig create mode 100644 official/release-3.2.16/api/stdinc.zig create mode 100644 official/release-3.2.16/api/tray.zig create mode 100644 official/release-3.2.16/json/guid.json create mode 100644 official/release-3.2.16/json/iostream.json create mode 100644 official/release-3.2.16/json/keyboard.json create mode 100644 official/release-3.2.16/json/opengl.json create mode 100644 official/release-3.2.16/json/pen.json create mode 100644 official/release-3.2.16/json/power.json create mode 100644 official/release-3.2.16/json/process.json create mode 100644 official/release-3.2.16/json/scancode.json create mode 100644 official/release-3.2.16/json/tray.json create mode 100644 official/release-3.2.18/api/c.zig create mode 100644 official/release-3.2.18/api/guid.zig create mode 100644 official/release-3.2.18/api/iostream.zig create mode 100644 official/release-3.2.18/api/keyboard.zig create mode 100644 official/release-3.2.18/api/opengl.zig create mode 100644 official/release-3.2.18/api/pen.zig create mode 100644 official/release-3.2.18/api/power.zig create mode 100644 official/release-3.2.18/api/process.zig create mode 100644 official/release-3.2.18/api/scancode.zig create mode 100644 official/release-3.2.18/api/stdinc.zig create mode 100644 official/release-3.2.18/api/tray.zig create mode 100644 official/release-3.2.18/json/guid.json create mode 100644 official/release-3.2.18/json/iostream.json create mode 100644 official/release-3.2.18/json/keyboard.json create mode 100644 official/release-3.2.18/json/opengl.json create mode 100644 official/release-3.2.18/json/pen.json create mode 100644 official/release-3.2.18/json/power.json create mode 100644 official/release-3.2.18/json/process.json create mode 100644 official/release-3.2.18/json/scancode.json create mode 100644 official/release-3.2.18/json/tray.json create mode 100644 official/release-3.2.2/api/c.zig create mode 100644 official/release-3.2.2/api/guid.zig create mode 100644 official/release-3.2.2/api/iostream.zig create mode 100644 official/release-3.2.2/api/keyboard.zig create mode 100644 official/release-3.2.2/api/opengl.zig create mode 100644 official/release-3.2.2/api/pen.zig create mode 100644 official/release-3.2.2/api/power.zig create mode 100644 official/release-3.2.2/api/process.zig create mode 100644 official/release-3.2.2/api/scancode.zig create mode 100644 official/release-3.2.2/api/stdinc.zig create mode 100644 official/release-3.2.2/api/tray.zig create mode 100644 official/release-3.2.2/json/guid.json create mode 100644 official/release-3.2.2/json/iostream.json create mode 100644 official/release-3.2.2/json/keyboard.json create mode 100644 official/release-3.2.2/json/opengl.json create mode 100644 official/release-3.2.2/json/pen.json create mode 100644 official/release-3.2.2/json/power.json create mode 100644 official/release-3.2.2/json/process.json create mode 100644 official/release-3.2.2/json/scancode.json create mode 100644 official/release-3.2.2/json/tray.json create mode 100644 official/release-3.2.20/api/c.zig create mode 100644 official/release-3.2.20/api/guid.zig create mode 100644 official/release-3.2.20/api/iostream.zig create mode 100644 official/release-3.2.20/api/keyboard.zig create mode 100644 official/release-3.2.20/api/opengl.zig create mode 100644 official/release-3.2.20/api/pen.zig create mode 100644 official/release-3.2.20/api/power.zig create mode 100644 official/release-3.2.20/api/process.zig create mode 100644 official/release-3.2.20/api/scancode.zig create mode 100644 official/release-3.2.20/api/stdinc.zig create mode 100644 official/release-3.2.20/api/tray.zig create mode 100644 official/release-3.2.20/json/guid.json create mode 100644 official/release-3.2.20/json/iostream.json create mode 100644 official/release-3.2.20/json/keyboard.json create mode 100644 official/release-3.2.20/json/opengl.json create mode 100644 official/release-3.2.20/json/pen.json create mode 100644 official/release-3.2.20/json/power.json create mode 100644 official/release-3.2.20/json/process.json create mode 100644 official/release-3.2.20/json/scancode.json create mode 100644 official/release-3.2.20/json/tray.json create mode 100644 official/release-3.2.22/api/c.zig create mode 100644 official/release-3.2.22/api/guid.zig create mode 100644 official/release-3.2.22/api/iostream.zig create mode 100644 official/release-3.2.22/api/keyboard.zig create mode 100644 official/release-3.2.22/api/opengl.zig create mode 100644 official/release-3.2.22/api/pen.zig create mode 100644 official/release-3.2.22/api/power.zig create mode 100644 official/release-3.2.22/api/process.zig create mode 100644 official/release-3.2.22/api/scancode.zig create mode 100644 official/release-3.2.22/api/stdinc.zig create mode 100644 official/release-3.2.22/api/tray.zig create mode 100644 official/release-3.2.22/json/guid.json create mode 100644 official/release-3.2.22/json/iostream.json create mode 100644 official/release-3.2.22/json/keyboard.json create mode 100644 official/release-3.2.22/json/opengl.json create mode 100644 official/release-3.2.22/json/pen.json create mode 100644 official/release-3.2.22/json/power.json create mode 100644 official/release-3.2.22/json/process.json create mode 100644 official/release-3.2.22/json/scancode.json create mode 100644 official/release-3.2.22/json/tray.json create mode 100644 official/release-3.2.24/api/c.zig create mode 100644 official/release-3.2.24/api/guid.zig create mode 100644 official/release-3.2.24/api/iostream.zig create mode 100644 official/release-3.2.24/api/keyboard.zig create mode 100644 official/release-3.2.24/api/opengl.zig create mode 100644 official/release-3.2.24/api/pen.zig create mode 100644 official/release-3.2.24/api/power.zig create mode 100644 official/release-3.2.24/api/process.zig create mode 100644 official/release-3.2.24/api/scancode.zig create mode 100644 official/release-3.2.24/api/stdinc.zig create mode 100644 official/release-3.2.24/api/tray.zig create mode 100644 official/release-3.2.24/json/guid.json create mode 100644 official/release-3.2.24/json/iostream.json create mode 100644 official/release-3.2.24/json/keyboard.json create mode 100644 official/release-3.2.24/json/opengl.json create mode 100644 official/release-3.2.24/json/pen.json create mode 100644 official/release-3.2.24/json/power.json create mode 100644 official/release-3.2.24/json/process.json create mode 100644 official/release-3.2.24/json/scancode.json create mode 100644 official/release-3.2.24/json/tray.json create mode 100644 official/release-3.2.26/api/c.zig create mode 100644 official/release-3.2.26/api/guid.zig create mode 100644 official/release-3.2.26/api/iostream.zig create mode 100644 official/release-3.2.26/api/keyboard.zig create mode 100644 official/release-3.2.26/api/opengl.zig create mode 100644 official/release-3.2.26/api/pen.zig create mode 100644 official/release-3.2.26/api/power.zig create mode 100644 official/release-3.2.26/api/process.zig create mode 100644 official/release-3.2.26/api/scancode.zig create mode 100644 official/release-3.2.26/api/stdinc.zig create mode 100644 official/release-3.2.26/api/tray.zig create mode 100644 official/release-3.2.26/json/guid.json create mode 100644 official/release-3.2.26/json/iostream.json create mode 100644 official/release-3.2.26/json/keyboard.json create mode 100644 official/release-3.2.26/json/opengl.json create mode 100644 official/release-3.2.26/json/pen.json create mode 100644 official/release-3.2.26/json/power.json create mode 100644 official/release-3.2.26/json/process.json create mode 100644 official/release-3.2.26/json/scancode.json create mode 100644 official/release-3.2.26/json/tray.json create mode 100644 official/release-3.2.28/api/c.zig create mode 100644 official/release-3.2.28/api/guid.zig create mode 100644 official/release-3.2.28/api/iostream.zig create mode 100644 official/release-3.2.28/api/keyboard.zig create mode 100644 official/release-3.2.28/api/opengl.zig create mode 100644 official/release-3.2.28/api/pen.zig create mode 100644 official/release-3.2.28/api/power.zig create mode 100644 official/release-3.2.28/api/process.zig create mode 100644 official/release-3.2.28/api/scancode.zig create mode 100644 official/release-3.2.28/api/stdinc.zig create mode 100644 official/release-3.2.28/api/tray.zig create mode 100644 official/release-3.2.28/json/guid.json create mode 100644 official/release-3.2.28/json/iostream.json create mode 100644 official/release-3.2.28/json/keyboard.json create mode 100644 official/release-3.2.28/json/opengl.json create mode 100644 official/release-3.2.28/json/pen.json create mode 100644 official/release-3.2.28/json/power.json create mode 100644 official/release-3.2.28/json/process.json create mode 100644 official/release-3.2.28/json/scancode.json create mode 100644 official/release-3.2.28/json/tray.json create mode 100644 official/release-3.2.30/api/c.zig create mode 100644 official/release-3.2.30/api/guid.zig create mode 100644 official/release-3.2.30/api/iostream.zig create mode 100644 official/release-3.2.30/api/keyboard.zig create mode 100644 official/release-3.2.30/api/opengl.zig create mode 100644 official/release-3.2.30/api/pen.zig create mode 100644 official/release-3.2.30/api/power.zig create mode 100644 official/release-3.2.30/api/process.zig create mode 100644 official/release-3.2.30/api/scancode.zig create mode 100644 official/release-3.2.30/api/stdinc.zig create mode 100644 official/release-3.2.30/api/tray.zig create mode 100644 official/release-3.2.30/json/guid.json create mode 100644 official/release-3.2.30/json/iostream.json create mode 100644 official/release-3.2.30/json/keyboard.json create mode 100644 official/release-3.2.30/json/opengl.json create mode 100644 official/release-3.2.30/json/pen.json create mode 100644 official/release-3.2.30/json/power.json create mode 100644 official/release-3.2.30/json/process.json create mode 100644 official/release-3.2.30/json/scancode.json create mode 100644 official/release-3.2.30/json/tray.json create mode 100644 official/release-3.2.4/api/c.zig create mode 100644 official/release-3.2.4/api/guid.zig create mode 100644 official/release-3.2.4/api/iostream.zig create mode 100644 official/release-3.2.4/api/keyboard.zig create mode 100644 official/release-3.2.4/api/opengl.zig create mode 100644 official/release-3.2.4/api/pen.zig create mode 100644 official/release-3.2.4/api/power.zig create mode 100644 official/release-3.2.4/api/process.zig create mode 100644 official/release-3.2.4/api/scancode.zig create mode 100644 official/release-3.2.4/api/stdinc.zig create mode 100644 official/release-3.2.4/api/tray.zig create mode 100644 official/release-3.2.4/json/guid.json create mode 100644 official/release-3.2.4/json/iostream.json create mode 100644 official/release-3.2.4/json/keyboard.json create mode 100644 official/release-3.2.4/json/opengl.json create mode 100644 official/release-3.2.4/json/pen.json create mode 100644 official/release-3.2.4/json/power.json create mode 100644 official/release-3.2.4/json/process.json create mode 100644 official/release-3.2.4/json/scancode.json create mode 100644 official/release-3.2.4/json/tray.json create mode 100644 official/release-3.2.6/api/c.zig create mode 100644 official/release-3.2.6/api/guid.zig create mode 100644 official/release-3.2.6/api/iostream.zig create mode 100644 official/release-3.2.6/api/keyboard.zig create mode 100644 official/release-3.2.6/api/opengl.zig create mode 100644 official/release-3.2.6/api/pen.zig create mode 100644 official/release-3.2.6/api/power.zig create mode 100644 official/release-3.2.6/api/process.zig create mode 100644 official/release-3.2.6/api/scancode.zig create mode 100644 official/release-3.2.6/api/stdinc.zig create mode 100644 official/release-3.2.6/api/tray.zig create mode 100644 official/release-3.2.6/json/guid.json create mode 100644 official/release-3.2.6/json/iostream.json create mode 100644 official/release-3.2.6/json/keyboard.json create mode 100644 official/release-3.2.6/json/opengl.json create mode 100644 official/release-3.2.6/json/pen.json create mode 100644 official/release-3.2.6/json/power.json create mode 100644 official/release-3.2.6/json/process.json create mode 100644 official/release-3.2.6/json/scancode.json create mode 100644 official/release-3.2.6/json/tray.json create mode 100644 official/release-3.2.8/api/c.zig create mode 100644 official/release-3.2.8/api/guid.zig create mode 100644 official/release-3.2.8/api/iostream.zig create mode 100644 official/release-3.2.8/api/keyboard.zig create mode 100644 official/release-3.2.8/api/opengl.zig create mode 100644 official/release-3.2.8/api/pen.zig create mode 100644 official/release-3.2.8/api/power.zig create mode 100644 official/release-3.2.8/api/process.zig create mode 100644 official/release-3.2.8/api/scancode.zig create mode 100644 official/release-3.2.8/api/stdinc.zig create mode 100644 official/release-3.2.8/api/tray.zig create mode 100644 official/release-3.2.8/json/guid.json create mode 100644 official/release-3.2.8/json/iostream.json create mode 100644 official/release-3.2.8/json/keyboard.json create mode 100644 official/release-3.2.8/json/opengl.json create mode 100644 official/release-3.2.8/json/pen.json create mode 100644 official/release-3.2.8/json/power.json create mode 100644 official/release-3.2.8/json/process.json create mode 100644 official/release-3.2.8/json/scancode.json create mode 100644 official/release-3.2.8/json/tray.json create mode 100644 official/release-3.4.0/api/c.zig create mode 100644 official/release-3.4.0/api/guid.zig create mode 100644 official/release-3.4.0/api/iostream.zig create mode 100644 official/release-3.4.0/api/keyboard.zig create mode 100644 official/release-3.4.0/api/opengl.zig create mode 100644 official/release-3.4.0/api/pen.zig create mode 100644 official/release-3.4.0/api/power.zig create mode 100644 official/release-3.4.0/api/process.zig create mode 100644 official/release-3.4.0/api/scancode.zig create mode 100644 official/release-3.4.0/api/stdinc.zig create mode 100644 official/release-3.4.0/api/tray.zig create mode 100644 official/release-3.4.0/json/guid.json create mode 100644 official/release-3.4.0/json/iostream.json create mode 100644 official/release-3.4.0/json/keyboard.json create mode 100644 official/release-3.4.0/json/opengl.json create mode 100644 official/release-3.4.0/json/pen.json create mode 100644 official/release-3.4.0/json/power.json create mode 100644 official/release-3.4.0/json/process.json create mode 100644 official/release-3.4.0/json/scancode.json create mode 100644 official/release-3.4.0/json/tray.json diff --git a/README.md b/README.md index 18df1ae..c948301 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,16 @@ git@github.com:castholm/SDL.git everything under official is generated from the official SDL repo git@github.com:libsdl-org/SDL.git + +## usage + +generated for zig 0.17.0 + +each release directory has an `api/` folder with one zig file per SDL header and a `json/` folder describing the same declarations. + +the files in `api/` import the translated C API through `api/c.zig`, which expects a `c.zig` next to the `api/` folder: + +```zig +// c.zig +pub const c = @import("sdl_c"); // e.g. a translate-c module of SDL3/SDL.h +``` diff --git a/castholm/v0.1.0-SDL-3.1.6/api/audio.zig b/castholm/v0.1.0-SDL-3.1.6/api/audio.zig index 65ed037..8b261f7 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/audio.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,107 +32,107 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -147,28 +148,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn pauseAudioDevice(dev: AudioDeviceID) bool { @@ -196,25 +197,25 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { } pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } pub inline fn unbindAudioStreams(streams: [*c]?*AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -223,22 +224,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/blendmode.zig b/castholm/v0.1.0-SDL-3.1.6/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/blendmode.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/c.zig b/castholm/v0.1.0-SDL-3.1.6/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/camera.zig b/castholm/v0.1.0-SDL-3.1.6/api/camera.zig index bb1e756..095f7e6 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/camera.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(devid, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/clipboard.zig b/castholm/v0.1.0-SDL-3.1.6/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/clipboard.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/dialog.zig b/castholm/v0.1.0-SDL-3.1.6/api/dialog.zig index f9c0684..06eb818 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/dialog.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/dialog.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -11,13 +12,13 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/error.zig b/castholm/v0.1.0-SDL-3.1.6/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/error.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.0-SDL-3.1.6/api/events.zig b/castholm/v0.1.0-SDL-3.1.6/api/events.zig index 4cf9630..75e6978 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/events.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/events.zig @@ -1,172 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = packed struct(u32) { - pad0: u31 = 0, - rsvd: bool = false, - - pub const None = PenID{}; -}; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -199,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -236,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventClipboardUpdate = 0x900, //The clipboard or primary selection changed @@ -263,10 +140,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -329,7 +215,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -425,6 +311,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -696,7 +583,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -716,19 +603,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -738,7 +625,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -766,5 +653,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/filesystem.zig b/castholm/v0.1.0-SDL-3.1.6/api/filesystem.zig index 042f144..dd0825b 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/filesystem.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,9 +83,9 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/gamepad.zig b/castholm/v0.1.0-SDL-3.1.6/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/gamepad.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/gpu.zig b/castholm/v0.1.0-SDL-3.1.6/api/gpu.zig index d34f7dc..9aa7217 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/gpu.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/gpu.zig @@ -1,173 +1,160 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -187,197 +174,197 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -676,7 +663,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -693,7 +680,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -854,9 +841,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -960,7 +947,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1077,11 +1064,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1093,9 +1080,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/guid.zig b/castholm/v0.1.0-SDL-3.1.6/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.0-SDL-3.1.6/api/haptic.zig b/castholm/v0.1.0-SDL-3.1.6/api/haptic.zig index f01f2a6..84f7d7d 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/haptic.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect - Not used ATM. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/hints.zig b/castholm/v0.1.0-SDL-3.1.6/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/hints.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/init.zig b/castholm/v0.1.0-SDL-3.1.6/api/init.zig index afbf3d1..dd2be06 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/init.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS` + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/iostream.zig b/castholm/v0.1.0-SDL-3.1.6/api/iostream.zig new file mode 100644 index 0000000..8c85855 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/iostream.zig @@ -0,0 +1,213 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} diff --git a/castholm/v0.1.0-SDL-3.1.6/api/joystick.zig b/castholm/v0.1.0-SDL-3.1.6/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/joystick.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/keyboard.zig b/castholm/v0.1.0-SDL-3.1.6/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.0-SDL-3.1.6/api/keycode.zig b/castholm/v0.1.0-SDL-3.1.6/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/keycode.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/loadso.zig b/castholm/v0.1.0-SDL-3.1.6/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/loadso.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/messagebox.zig b/castholm/v0.1.0-SDL-3.1.6/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/messagebox.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/misc.zig b/castholm/v0.1.0-SDL-3.1.6/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/misc.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/mouse.zig b/castholm/v0.1.0-SDL-3.1.6/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/mouse.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/opengl.zig b/castholm/v0.1.0-SDL-3.1.6/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/pen.zig b/castholm/v0.1.0-SDL-3.1.6/api/pen.zig new file mode 100644 index 0000000..4c30b90 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/pen.zig @@ -0,0 +1,33 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = packed struct(u32) { + pad0: u31 = 0, + rsvd: bool = false, + + pub const None = PenID{}; +}; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/pixels.zig b/castholm/v0.1.0-SDL-3.1.6/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/pixels.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/power.zig b/castholm/v0.1.0-SDL-3.1.6/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.0-SDL-3.1.6/api/process.zig b/castholm/v0.1.0-SDL-3.1.6/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.0-SDL-3.1.6/api/properties.zig b/castholm/v0.1.0-SDL-3.1.6/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/properties.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/rect.zig b/castholm/v0.1.0-SDL-3.1.6/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/rect.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/render.zig b/castholm/v0.1.0-SDL-3.1.6/api/render.zig index 589569e..8ec6156 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/render.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/render.zig @@ -1,788 +1,93 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id or SDL_TOUCH_MOUSEID - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - n_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_MOTION or SDL_EVENT_FINGER_DOWN or SDL_EVENT_FINGER_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id, SDL_TOUCH_MOUSEID - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id, SDL_TOUCH_MOUSEID - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = packed struct(u32) { - pad0: u31 = 0, - rsvd: bool = false, - - pub const None = PenID{}; -}; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; -}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; pub const Vertex = extern struct { position: FPoint, // Vertex position, in SDL_Renderer coordinates @@ -806,325 +111,325 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1137,9 +442,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/scancode.zig b/castholm/v0.1.0-SDL-3.1.6/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/sensor.zig b/castholm/v0.1.0-SDL-3.1.6/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/sensor.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/stdinc.zig b/castholm/v0.1.0-SDL-3.1.6/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.0-SDL-3.1.6/api/storage.zig b/castholm/v0.1.0-SDL-3.1.6/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/storage.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/surface.zig b/castholm/v0.1.0-SDL-3.1.6/api/surface.zig index 64a300e..22787cd 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/surface.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/system.zig b/castholm/v0.1.0-SDL-3.1.6/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/system.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/time.zig b/castholm/v0.1.0-SDL-3.1.6/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/time.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.0-SDL-3.1.6/api/timer.zig b/castholm/v0.1.0-SDL-3.1.6/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/timer.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/touch.zig b/castholm/v0.1.0-SDL-3.1.6/api/touch.zig index 8999302..2e5c198 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/touch.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/touch.zig @@ -1,14 +1,14 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, touchDeviceIndirectAbsolute, - touchDeviceIndirectRelative /* trackpad with screen cursor-relative coordinates */, + touchDeviceIndirectRelative, }; pub const Finger = extern struct { @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,10 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } - diff --git a/castholm/v0.1.0-SDL-3.1.6/api/version.zig b/castholm/v0.1.0-SDL-3.1.6/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/version.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.0-SDL-3.1.6/api/video.zig b/castholm/v0.1.0-SDL-3.1.6/api/video.zig index 2b99216..53956a1 100644 --- a/castholm/v0.1.0-SDL-3.1.6/api/video.zig +++ b/castholm/v0.1.0-SDL-3.1.6/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, mode: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(mode))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(mode)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.0-SDL-3.1.6/debug/error_SDL_touch_h.zig b/castholm/v0.1.0-SDL-3.1.6/debug/error_SDL_touch_h.zig deleted file mode 100644 index 8999302..0000000 --- a/castholm/v0.1.0-SDL-3.1.6/debug/error_SDL_touch_h.zig +++ /dev/null @@ -1,36 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const TouchDeviceType = enum(c_int) { - touchDeviceDirect, - touchDeviceIndirectAbsolute, - touchDeviceIndirectRelative /* trackpad with screen cursor-relative coordinates */, -}; - -pub const Finger = extern struct { - id: FingerID, // the finger ID - x: f32, // the x-axis location of the touch event, normalized (0...1) - y: f32, // the y-axis location of the touch event, normalized (0...1) - pressure: f32, // the quantity of pressure applied, normalized (0...1) -}; - -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); -} - -pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { - return c.SDL_GetTouchDeviceName(touchID); -} - -pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); -} - -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); -} - diff --git a/castholm/v0.1.0-SDL-3.1.6/json/audio.json b/castholm/v0.1.0-SDL-3.1.6/json/audio.json index 9d44ec6..fc8db8a 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/audio.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.0-SDL-3.1.6/json/blendmode.json b/castholm/v0.1.0-SDL-3.1.6/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/blendmode.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.0-SDL-3.1.6/json/events.json b/castholm/v0.1.0-SDL-3.1.6/json/events.json index 8cb5237..381104c 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/events.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -433,6 +461,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -446,6 +478,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1080,6 +1124,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.0-SDL-3.1.6/json/filesystem.json b/castholm/v0.1.0-SDL-3.1.6/json/filesystem.json index 9e192f1..1a49be9 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/filesystem.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.0-SDL-3.1.6/json/gamepad.json b/castholm/v0.1.0-SDL-3.1.6/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/gamepad.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.0-SDL-3.1.6/json/gpu.json b/castholm/v0.1.0-SDL-3.1.6/json/gpu.json index 55e503d..dbcc093 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/gpu.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.0-SDL-3.1.6/json/guid.json b/castholm/v0.1.0-SDL-3.1.6/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/haptic.json b/castholm/v0.1.0-SDL-3.1.6/json/haptic.json index 9e4036b..ec11456 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/haptic.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.0-SDL-3.1.6/json/iostream.json b/castholm/v0.1.0-SDL-3.1.6/json/iostream.json new file mode 100644 index 0000000..f8c72c2 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/iostream.json @@ -0,0 +1,697 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/joystick.json b/castholm/v0.1.0-SDL-3.1.6/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/joystick.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.0-SDL-3.1.6/json/keyboard.json b/castholm/v0.1.0-SDL-3.1.6/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/opengl.json b/castholm/v0.1.0-SDL-3.1.6/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/pen.json b/castholm/v0.1.0-SDL-3.1.6/json/pen.json new file mode 100644 index 0000000..f12ca89 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32", + "values": [] + }, + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/pixels.json b/castholm/v0.1.0-SDL-3.1.6/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/pixels.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.0-SDL-3.1.6/json/power.json b/castholm/v0.1.0-SDL-3.1.6/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/process.json b/castholm/v0.1.0-SDL-3.1.6/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/scancode.json b/castholm/v0.1.0-SDL-3.1.6/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.0-SDL-3.1.6/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.0-SDL-3.1.6/json/system.json b/castholm/v0.1.0-SDL-3.1.6/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/system.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.0-SDL-3.1.6/json/touch.json b/castholm/v0.1.0-SDL-3.1.6/json/touch.json index 7e069d8..ce8c82c 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/touch.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT" }, @@ -24,7 +28,7 @@ "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE" }, { - "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */" + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE" } ] } diff --git a/castholm/v0.1.0-SDL-3.1.6/json/video.json b/castholm/v0.1.0-SDL-3.1.6/json/video.json index 08ee60c..87d6a17 100644 --- a/castholm/v0.1.0-SDL-3.1.6/json/video.json +++ b/castholm/v0.1.0-SDL-3.1.6/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.1.1-SDL-3.1.8/api/audio.zig b/castholm/v0.1.1-SDL-3.1.8/api/audio.zig index 74181f7..05b7974 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/audio.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,107 +32,107 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -147,28 +148,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -203,26 +204,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -231,22 +232,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/blendmode.zig b/castholm/v0.1.1-SDL-3.1.8/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/blendmode.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/c.zig b/castholm/v0.1.1-SDL-3.1.8/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/camera.zig b/castholm/v0.1.1-SDL-3.1.8/api/camera.zig index bb1e756..095f7e6 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/camera.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(devid, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/clipboard.zig b/castholm/v0.1.1-SDL-3.1.8/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/clipboard.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/dialog.zig b/castholm/v0.1.1-SDL-3.1.8/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/dialog.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/error.zig b/castholm/v0.1.1-SDL-3.1.8/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/error.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.1-SDL-3.1.8/api/events.zig b/castholm/v0.1.1-SDL-3.1.8/api/events.zig index 1551c2b..d1227c3 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/events.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/events.zig @@ -1,172 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = packed struct(u32) { - pad0: u31 = 0, - rsvd: bool = false, - - pub const None = PenID{}; -}; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -199,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -236,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -264,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -330,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -426,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -705,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -725,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -747,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -775,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/filesystem.zig b/castholm/v0.1.1-SDL-3.1.8/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/filesystem.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/gamepad.zig b/castholm/v0.1.1-SDL-3.1.8/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/gamepad.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/gpu.zig b/castholm/v0.1.1-SDL-3.1.8/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/gpu.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/guid.zig b/castholm/v0.1.1-SDL-3.1.8/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/haptic.zig b/castholm/v0.1.1-SDL-3.1.8/api/haptic.zig index f01f2a6..84f7d7d 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/haptic.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect - Not used ATM. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/hints.zig b/castholm/v0.1.1-SDL-3.1.8/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/hints.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/init.zig b/castholm/v0.1.1-SDL-3.1.8/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/init.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/iostream.zig b/castholm/v0.1.1-SDL-3.1.8/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/joystick.zig b/castholm/v0.1.1-SDL-3.1.8/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/joystick.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/keyboard.zig b/castholm/v0.1.1-SDL-3.1.8/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/keycode.zig b/castholm/v0.1.1-SDL-3.1.8/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/keycode.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/loadso.zig b/castholm/v0.1.1-SDL-3.1.8/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/loadso.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/messagebox.zig b/castholm/v0.1.1-SDL-3.1.8/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/messagebox.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/misc.zig b/castholm/v0.1.1-SDL-3.1.8/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/misc.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/mouse.zig b/castholm/v0.1.1-SDL-3.1.8/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/mouse.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/opengl.zig b/castholm/v0.1.1-SDL-3.1.8/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/pen.zig b/castholm/v0.1.1-SDL-3.1.8/api/pen.zig new file mode 100644 index 0000000..4c30b90 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/pen.zig @@ -0,0 +1,33 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = packed struct(u32) { + pad0: u31 = 0, + rsvd: bool = false, + + pub const None = PenID{}; +}; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/pixels.zig b/castholm/v0.1.1-SDL-3.1.8/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/pixels.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/power.zig b/castholm/v0.1.1-SDL-3.1.8/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/process.zig b/castholm/v0.1.1-SDL-3.1.8/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/properties.zig b/castholm/v0.1.1-SDL-3.1.8/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/properties.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/rect.zig b/castholm/v0.1.1-SDL-3.1.8/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/rect.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/render.zig b/castholm/v0.1.1-SDL-3.1.8/api/render.zig index 3a8352e..0c57be7 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/render.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/render.zig @@ -1,796 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = packed struct(u32) { - pad0: u31 = 0, - rsvd: bool = false, - - pub const None = PenID{}; -}; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -815,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1150,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/scancode.zig b/castholm/v0.1.1-SDL-3.1.8/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/sensor.zig b/castholm/v0.1.1-SDL-3.1.8/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/sensor.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/stdinc.zig b/castholm/v0.1.1-SDL-3.1.8/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.1-SDL-3.1.8/api/storage.zig b/castholm/v0.1.1-SDL-3.1.8/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/storage.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/surface.zig b/castholm/v0.1.1-SDL-3.1.8/api/surface.zig index 64a300e..22787cd 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/surface.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/system.zig b/castholm/v0.1.1-SDL-3.1.8/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/system.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/time.zig b/castholm/v0.1.1-SDL-3.1.8/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/time.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.1-SDL-3.1.8/api/timer.zig b/castholm/v0.1.1-SDL-3.1.8/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/timer.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/touch.zig b/castholm/v0.1.1-SDL-3.1.8/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/touch.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/tray.zig b/castholm/v0.1.1-SDL-3.1.8/api/tray.zig new file mode 100644 index 0000000..9297ce1 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/api/tray.zig @@ -0,0 +1,108 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} diff --git a/castholm/v0.1.1-SDL-3.1.8/api/version.zig b/castholm/v0.1.1-SDL-3.1.8/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/version.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.1-SDL-3.1.8/api/video.zig b/castholm/v0.1.1-SDL-3.1.8/api/video.zig index 9125b0e..e43f76c 100644 --- a/castholm/v0.1.1-SDL-3.1.8/api/video.zig +++ b/castholm/v0.1.1-SDL-3.1.8/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.1-SDL-3.1.8/json/audio.json b/castholm/v0.1.1-SDL-3.1.8/json/audio.json index c0325c8..25f3965 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/audio.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.1-SDL-3.1.8/json/blendmode.json b/castholm/v0.1.1-SDL-3.1.8/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/blendmode.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.1-SDL-3.1.8/json/events.json b/castholm/v0.1.1-SDL-3.1.8/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/events.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.1-SDL-3.1.8/json/filesystem.json b/castholm/v0.1.1-SDL-3.1.8/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/filesystem.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.1-SDL-3.1.8/json/gamepad.json b/castholm/v0.1.1-SDL-3.1.8/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/gamepad.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.1-SDL-3.1.8/json/gpu.json b/castholm/v0.1.1-SDL-3.1.8/json/gpu.json index b1de6d6..a63962c 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/gpu.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.1-SDL-3.1.8/json/guid.json b/castholm/v0.1.1-SDL-3.1.8/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/haptic.json b/castholm/v0.1.1-SDL-3.1.8/json/haptic.json index 9e4036b..ec11456 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/haptic.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.1-SDL-3.1.8/json/iostream.json b/castholm/v0.1.1-SDL-3.1.8/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/joystick.json b/castholm/v0.1.1-SDL-3.1.8/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/joystick.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.1-SDL-3.1.8/json/keyboard.json b/castholm/v0.1.1-SDL-3.1.8/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/opengl.json b/castholm/v0.1.1-SDL-3.1.8/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/pen.json b/castholm/v0.1.1-SDL-3.1.8/json/pen.json new file mode 100644 index 0000000..f12ca89 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32", + "values": [] + }, + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/pixels.json b/castholm/v0.1.1-SDL-3.1.8/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/pixels.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.1-SDL-3.1.8/json/power.json b/castholm/v0.1.1-SDL-3.1.8/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/process.json b/castholm/v0.1.1-SDL-3.1.8/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/scancode.json b/castholm/v0.1.1-SDL-3.1.8/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/system.json b/castholm/v0.1.1-SDL-3.1.8/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/system.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.1-SDL-3.1.8/json/touch.json b/castholm/v0.1.1-SDL-3.1.8/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/touch.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.1.1-SDL-3.1.8/json/tray.json b/castholm/v0.1.1-SDL-3.1.8/json/tray.json new file mode 100644 index 0000000..50883b4 --- /dev/null +++ b/castholm/v0.1.1-SDL-3.1.8/json/tray.json @@ -0,0 +1,317 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.1-SDL-3.1.8/json/video.json b/castholm/v0.1.1-SDL-3.1.8/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.1.1-SDL-3.1.8/json/video.json +++ b/castholm/v0.1.1-SDL-3.1.8/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.1.2-SDL-3.1.10/api/audio.zig b/castholm/v0.1.2-SDL-3.1.10/api/audio.zig index 3564f87..293bbd0 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/audio.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/blendmode.zig b/castholm/v0.1.2-SDL-3.1.10/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/blendmode.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/c.zig b/castholm/v0.1.2-SDL-3.1.10/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/camera.zig b/castholm/v0.1.2-SDL-3.1.10/api/camera.zig index bb1e756..095f7e6 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/camera.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(devid, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/clipboard.zig b/castholm/v0.1.2-SDL-3.1.10/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/clipboard.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/dialog.zig b/castholm/v0.1.2-SDL-3.1.10/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/dialog.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/error.zig b/castholm/v0.1.2-SDL-3.1.10/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/error.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.2-SDL-3.1.10/api/events.zig b/castholm/v0.1.2-SDL-3.1.10/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/events.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/filesystem.zig b/castholm/v0.1.2-SDL-3.1.10/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/filesystem.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/gamepad.zig b/castholm/v0.1.2-SDL-3.1.10/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/gamepad.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/gpu.zig b/castholm/v0.1.2-SDL-3.1.10/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/gpu.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/guid.zig b/castholm/v0.1.2-SDL-3.1.10/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/haptic.zig b/castholm/v0.1.2-SDL-3.1.10/api/haptic.zig index f01f2a6..84f7d7d 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/haptic.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect - Not used ATM. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/hints.zig b/castholm/v0.1.2-SDL-3.1.10/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/hints.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/init.zig b/castholm/v0.1.2-SDL-3.1.10/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/init.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/iostream.zig b/castholm/v0.1.2-SDL-3.1.10/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/joystick.zig b/castholm/v0.1.2-SDL-3.1.10/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/joystick.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/keyboard.zig b/castholm/v0.1.2-SDL-3.1.10/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/keycode.zig b/castholm/v0.1.2-SDL-3.1.10/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/keycode.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/loadso.zig b/castholm/v0.1.2-SDL-3.1.10/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/loadso.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/messagebox.zig b/castholm/v0.1.2-SDL-3.1.10/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/messagebox.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/misc.zig b/castholm/v0.1.2-SDL-3.1.10/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/misc.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/mouse.zig b/castholm/v0.1.2-SDL-3.1.10/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/mouse.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/opengl.zig b/castholm/v0.1.2-SDL-3.1.10/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/pen.zig b/castholm/v0.1.2-SDL-3.1.10/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/pixels.zig b/castholm/v0.1.2-SDL-3.1.10/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/pixels.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/power.zig b/castholm/v0.1.2-SDL-3.1.10/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/process.zig b/castholm/v0.1.2-SDL-3.1.10/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/properties.zig b/castholm/v0.1.2-SDL-3.1.10/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/properties.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/rect.zig b/castholm/v0.1.2-SDL-3.1.10/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/rect.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/render.zig b/castholm/v0.1.2-SDL-3.1.10/api/render.zig index aaad785..0c57be7 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/render.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/scancode.zig b/castholm/v0.1.2-SDL-3.1.10/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/sensor.zig b/castholm/v0.1.2-SDL-3.1.10/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/sensor.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/stdinc.zig b/castholm/v0.1.2-SDL-3.1.10/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.2-SDL-3.1.10/api/storage.zig b/castholm/v0.1.2-SDL-3.1.10/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/storage.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/surface.zig b/castholm/v0.1.2-SDL-3.1.10/api/surface.zig index 64a300e..22787cd 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/surface.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/system.zig b/castholm/v0.1.2-SDL-3.1.10/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/system.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/time.zig b/castholm/v0.1.2-SDL-3.1.10/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/time.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.2-SDL-3.1.10/api/timer.zig b/castholm/v0.1.2-SDL-3.1.10/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/timer.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/touch.zig b/castholm/v0.1.2-SDL-3.1.10/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/touch.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/tray.zig b/castholm/v0.1.2-SDL-3.1.10/api/tray.zig new file mode 100644 index 0000000..4c2df66 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/api/tray.zig @@ -0,0 +1,112 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} diff --git a/castholm/v0.1.2-SDL-3.1.10/api/version.zig b/castholm/v0.1.2-SDL-3.1.10/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/version.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.2-SDL-3.1.10/api/video.zig b/castholm/v0.1.2-SDL-3.1.10/api/video.zig index 9125b0e..e43f76c 100644 --- a/castholm/v0.1.2-SDL-3.1.10/api/video.zig +++ b/castholm/v0.1.2-SDL-3.1.10/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.2-SDL-3.1.10/json/audio.json b/castholm/v0.1.2-SDL-3.1.10/json/audio.json index 2f74550..1a12cf4 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/audio.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.2-SDL-3.1.10/json/blendmode.json b/castholm/v0.1.2-SDL-3.1.10/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/blendmode.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.2-SDL-3.1.10/json/events.json b/castholm/v0.1.2-SDL-3.1.10/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/events.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.2-SDL-3.1.10/json/filesystem.json b/castholm/v0.1.2-SDL-3.1.10/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/filesystem.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.2-SDL-3.1.10/json/gamepad.json b/castholm/v0.1.2-SDL-3.1.10/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/gamepad.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.2-SDL-3.1.10/json/gpu.json b/castholm/v0.1.2-SDL-3.1.10/json/gpu.json index b1de6d6..a63962c 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/gpu.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.2-SDL-3.1.10/json/guid.json b/castholm/v0.1.2-SDL-3.1.10/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/haptic.json b/castholm/v0.1.2-SDL-3.1.10/json/haptic.json index 9e4036b..ec11456 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/haptic.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.2-SDL-3.1.10/json/iostream.json b/castholm/v0.1.2-SDL-3.1.10/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/joystick.json b/castholm/v0.1.2-SDL-3.1.10/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/joystick.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.2-SDL-3.1.10/json/keyboard.json b/castholm/v0.1.2-SDL-3.1.10/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/opengl.json b/castholm/v0.1.2-SDL-3.1.10/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/pen.json b/castholm/v0.1.2-SDL-3.1.10/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/pixels.json b/castholm/v0.1.2-SDL-3.1.10/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/pixels.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.2-SDL-3.1.10/json/power.json b/castholm/v0.1.2-SDL-3.1.10/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/process.json b/castholm/v0.1.2-SDL-3.1.10/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/scancode.json b/castholm/v0.1.2-SDL-3.1.10/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/system.json b/castholm/v0.1.2-SDL-3.1.10/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/system.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.2-SDL-3.1.10/json/touch.json b/castholm/v0.1.2-SDL-3.1.10/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/touch.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.1.2-SDL-3.1.10/json/tray.json b/castholm/v0.1.2-SDL-3.1.10/json/tray.json new file mode 100644 index 0000000..93ed012 --- /dev/null +++ b/castholm/v0.1.2-SDL-3.1.10/json/tray.json @@ -0,0 +1,327 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.2-SDL-3.1.10/json/video.json b/castholm/v0.1.2-SDL-3.1.10/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.1.2-SDL-3.1.10/json/video.json +++ b/castholm/v0.1.2-SDL-3.1.10/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.1.3-SDL-3.2.0/api/audio.zig b/castholm/v0.1.3-SDL-3.2.0/api/audio.zig index 3564f87..293bbd0 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/audio.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/blendmode.zig b/castholm/v0.1.3-SDL-3.2.0/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/blendmode.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/c.zig b/castholm/v0.1.3-SDL-3.2.0/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/camera.zig b/castholm/v0.1.3-SDL-3.2.0/api/camera.zig index bb1e756..095f7e6 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/camera.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(devid, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/clipboard.zig b/castholm/v0.1.3-SDL-3.2.0/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/clipboard.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/dialog.zig b/castholm/v0.1.3-SDL-3.2.0/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/dialog.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/error.zig b/castholm/v0.1.3-SDL-3.2.0/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/error.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.3-SDL-3.2.0/api/events.zig b/castholm/v0.1.3-SDL-3.2.0/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/events.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/filesystem.zig b/castholm/v0.1.3-SDL-3.2.0/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/filesystem.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/gamepad.zig b/castholm/v0.1.3-SDL-3.2.0/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/gamepad.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/gpu.zig b/castholm/v0.1.3-SDL-3.2.0/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/gpu.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/guid.zig b/castholm/v0.1.3-SDL-3.2.0/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/haptic.zig b/castholm/v0.1.3-SDL-3.2.0/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/haptic.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/hints.zig b/castholm/v0.1.3-SDL-3.2.0/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/hints.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/init.zig b/castholm/v0.1.3-SDL-3.2.0/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/init.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/iostream.zig b/castholm/v0.1.3-SDL-3.2.0/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/joystick.zig b/castholm/v0.1.3-SDL-3.2.0/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/joystick.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/keyboard.zig b/castholm/v0.1.3-SDL-3.2.0/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/keycode.zig b/castholm/v0.1.3-SDL-3.2.0/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/keycode.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/loadso.zig b/castholm/v0.1.3-SDL-3.2.0/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/loadso.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/messagebox.zig b/castholm/v0.1.3-SDL-3.2.0/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/messagebox.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/misc.zig b/castholm/v0.1.3-SDL-3.2.0/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/misc.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/mouse.zig b/castholm/v0.1.3-SDL-3.2.0/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/mouse.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/opengl.zig b/castholm/v0.1.3-SDL-3.2.0/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/pen.zig b/castholm/v0.1.3-SDL-3.2.0/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/pixels.zig b/castholm/v0.1.3-SDL-3.2.0/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/pixels.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/power.zig b/castholm/v0.1.3-SDL-3.2.0/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/process.zig b/castholm/v0.1.3-SDL-3.2.0/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/properties.zig b/castholm/v0.1.3-SDL-3.2.0/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/properties.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/rect.zig b/castholm/v0.1.3-SDL-3.2.0/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/rect.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/render.zig b/castholm/v0.1.3-SDL-3.2.0/api/render.zig index aaad785..0c57be7 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/render.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/scancode.zig b/castholm/v0.1.3-SDL-3.2.0/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/sensor.zig b/castholm/v0.1.3-SDL-3.2.0/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/sensor.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/stdinc.zig b/castholm/v0.1.3-SDL-3.2.0/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.3-SDL-3.2.0/api/storage.zig b/castholm/v0.1.3-SDL-3.2.0/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/storage.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/surface.zig b/castholm/v0.1.3-SDL-3.2.0/api/surface.zig index 64a300e..22787cd 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/surface.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/system.zig b/castholm/v0.1.3-SDL-3.2.0/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/system.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/time.zig b/castholm/v0.1.3-SDL-3.2.0/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/time.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.3-SDL-3.2.0/api/timer.zig b/castholm/v0.1.3-SDL-3.2.0/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/timer.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/touch.zig b/castholm/v0.1.3-SDL-3.2.0/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/touch.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/tray.zig b/castholm/v0.1.3-SDL-3.2.0/api/tray.zig new file mode 100644 index 0000000..2d6248a --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.1.3-SDL-3.2.0/api/version.zig b/castholm/v0.1.3-SDL-3.2.0/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/version.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.3-SDL-3.2.0/api/video.zig b/castholm/v0.1.3-SDL-3.2.0/api/video.zig index 9125b0e..e43f76c 100644 --- a/castholm/v0.1.3-SDL-3.2.0/api/video.zig +++ b/castholm/v0.1.3-SDL-3.2.0/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.3-SDL-3.2.0/json/audio.json b/castholm/v0.1.3-SDL-3.2.0/json/audio.json index 2f74550..1a12cf4 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/audio.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.3-SDL-3.2.0/json/blendmode.json b/castholm/v0.1.3-SDL-3.2.0/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/blendmode.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.3-SDL-3.2.0/json/events.json b/castholm/v0.1.3-SDL-3.2.0/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/events.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.3-SDL-3.2.0/json/filesystem.json b/castholm/v0.1.3-SDL-3.2.0/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/filesystem.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.3-SDL-3.2.0/json/gamepad.json b/castholm/v0.1.3-SDL-3.2.0/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/gamepad.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.3-SDL-3.2.0/json/gpu.json b/castholm/v0.1.3-SDL-3.2.0/json/gpu.json index b1de6d6..a63962c 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/gpu.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.3-SDL-3.2.0/json/guid.json b/castholm/v0.1.3-SDL-3.2.0/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/haptic.json b/castholm/v0.1.3-SDL-3.2.0/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/haptic.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.3-SDL-3.2.0/json/iostream.json b/castholm/v0.1.3-SDL-3.2.0/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/joystick.json b/castholm/v0.1.3-SDL-3.2.0/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/joystick.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.3-SDL-3.2.0/json/keyboard.json b/castholm/v0.1.3-SDL-3.2.0/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/opengl.json b/castholm/v0.1.3-SDL-3.2.0/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/pen.json b/castholm/v0.1.3-SDL-3.2.0/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/pixels.json b/castholm/v0.1.3-SDL-3.2.0/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/pixels.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.3-SDL-3.2.0/json/power.json b/castholm/v0.1.3-SDL-3.2.0/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/process.json b/castholm/v0.1.3-SDL-3.2.0/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/scancode.json b/castholm/v0.1.3-SDL-3.2.0/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/system.json b/castholm/v0.1.3-SDL-3.2.0/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/system.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.3-SDL-3.2.0/json/touch.json b/castholm/v0.1.3-SDL-3.2.0/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/touch.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.1.3-SDL-3.2.0/json/tray.json b/castholm/v0.1.3-SDL-3.2.0/json/tray.json new file mode 100644 index 0000000..949e5a5 --- /dev/null +++ b/castholm/v0.1.3-SDL-3.2.0/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.3-SDL-3.2.0/json/video.json b/castholm/v0.1.3-SDL-3.2.0/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.1.3-SDL-3.2.0/json/video.json +++ b/castholm/v0.1.3-SDL-3.2.0/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.1.4-SDL-3.2.2/api/audio.zig b/castholm/v0.1.4-SDL-3.2.2/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/audio.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/blendmode.zig b/castholm/v0.1.4-SDL-3.2.2/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/blendmode.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/c.zig b/castholm/v0.1.4-SDL-3.2.2/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/camera.zig b/castholm/v0.1.4-SDL-3.2.2/api/camera.zig index 5d16142..7a9ccd3 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/camera.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/clipboard.zig b/castholm/v0.1.4-SDL-3.2.2/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/clipboard.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/dialog.zig b/castholm/v0.1.4-SDL-3.2.2/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/dialog.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/error.zig b/castholm/v0.1.4-SDL-3.2.2/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/error.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.4-SDL-3.2.2/api/events.zig b/castholm/v0.1.4-SDL-3.2.2/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/events.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/filesystem.zig b/castholm/v0.1.4-SDL-3.2.2/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/filesystem.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/gamepad.zig b/castholm/v0.1.4-SDL-3.2.2/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/gamepad.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/gpu.zig b/castholm/v0.1.4-SDL-3.2.2/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/gpu.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/guid.zig b/castholm/v0.1.4-SDL-3.2.2/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/haptic.zig b/castholm/v0.1.4-SDL-3.2.2/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/haptic.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/hints.zig b/castholm/v0.1.4-SDL-3.2.2/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/hints.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/init.zig b/castholm/v0.1.4-SDL-3.2.2/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/init.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/iostream.zig b/castholm/v0.1.4-SDL-3.2.2/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/joystick.zig b/castholm/v0.1.4-SDL-3.2.2/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/joystick.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/keyboard.zig b/castholm/v0.1.4-SDL-3.2.2/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/keycode.zig b/castholm/v0.1.4-SDL-3.2.2/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/keycode.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/loadso.zig b/castholm/v0.1.4-SDL-3.2.2/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/loadso.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/messagebox.zig b/castholm/v0.1.4-SDL-3.2.2/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/messagebox.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/misc.zig b/castholm/v0.1.4-SDL-3.2.2/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/misc.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/mouse.zig b/castholm/v0.1.4-SDL-3.2.2/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/mouse.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/opengl.zig b/castholm/v0.1.4-SDL-3.2.2/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/pen.zig b/castholm/v0.1.4-SDL-3.2.2/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/pixels.zig b/castholm/v0.1.4-SDL-3.2.2/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/pixels.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/power.zig b/castholm/v0.1.4-SDL-3.2.2/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/process.zig b/castholm/v0.1.4-SDL-3.2.2/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/properties.zig b/castholm/v0.1.4-SDL-3.2.2/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/properties.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/rect.zig b/castholm/v0.1.4-SDL-3.2.2/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/rect.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/render.zig b/castholm/v0.1.4-SDL-3.2.2/api/render.zig index aaad785..0c57be7 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/render.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/scancode.zig b/castholm/v0.1.4-SDL-3.2.2/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/sensor.zig b/castholm/v0.1.4-SDL-3.2.2/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/sensor.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/stdinc.zig b/castholm/v0.1.4-SDL-3.2.2/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.4-SDL-3.2.2/api/storage.zig b/castholm/v0.1.4-SDL-3.2.2/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/storage.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/surface.zig b/castholm/v0.1.4-SDL-3.2.2/api/surface.zig index 64a300e..22787cd 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/surface.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/system.zig b/castholm/v0.1.4-SDL-3.2.2/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/system.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/time.zig b/castholm/v0.1.4-SDL-3.2.2/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/time.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.4-SDL-3.2.2/api/timer.zig b/castholm/v0.1.4-SDL-3.2.2/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/timer.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/touch.zig b/castholm/v0.1.4-SDL-3.2.2/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/touch.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/tray.zig b/castholm/v0.1.4-SDL-3.2.2/api/tray.zig new file mode 100644 index 0000000..2d6248a --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.1.4-SDL-3.2.2/api/version.zig b/castholm/v0.1.4-SDL-3.2.2/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/version.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.4-SDL-3.2.2/api/video.zig b/castholm/v0.1.4-SDL-3.2.2/api/video.zig index 9125b0e..e43f76c 100644 --- a/castholm/v0.1.4-SDL-3.2.2/api/video.zig +++ b/castholm/v0.1.4-SDL-3.2.2/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.4-SDL-3.2.2/json/audio.json b/castholm/v0.1.4-SDL-3.2.2/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/audio.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.4-SDL-3.2.2/json/blendmode.json b/castholm/v0.1.4-SDL-3.2.2/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/blendmode.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.4-SDL-3.2.2/json/events.json b/castholm/v0.1.4-SDL-3.2.2/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/events.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.4-SDL-3.2.2/json/filesystem.json b/castholm/v0.1.4-SDL-3.2.2/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/filesystem.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.4-SDL-3.2.2/json/gamepad.json b/castholm/v0.1.4-SDL-3.2.2/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/gamepad.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.4-SDL-3.2.2/json/gpu.json b/castholm/v0.1.4-SDL-3.2.2/json/gpu.json index b1de6d6..a63962c 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/gpu.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.4-SDL-3.2.2/json/guid.json b/castholm/v0.1.4-SDL-3.2.2/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/haptic.json b/castholm/v0.1.4-SDL-3.2.2/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/haptic.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.4-SDL-3.2.2/json/iostream.json b/castholm/v0.1.4-SDL-3.2.2/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/joystick.json b/castholm/v0.1.4-SDL-3.2.2/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/joystick.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.4-SDL-3.2.2/json/keyboard.json b/castholm/v0.1.4-SDL-3.2.2/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/opengl.json b/castholm/v0.1.4-SDL-3.2.2/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/pen.json b/castholm/v0.1.4-SDL-3.2.2/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/pixels.json b/castholm/v0.1.4-SDL-3.2.2/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/pixels.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.4-SDL-3.2.2/json/power.json b/castholm/v0.1.4-SDL-3.2.2/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/process.json b/castholm/v0.1.4-SDL-3.2.2/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/scancode.json b/castholm/v0.1.4-SDL-3.2.2/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/system.json b/castholm/v0.1.4-SDL-3.2.2/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/system.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.4-SDL-3.2.2/json/touch.json b/castholm/v0.1.4-SDL-3.2.2/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/touch.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.1.4-SDL-3.2.2/json/tray.json b/castholm/v0.1.4-SDL-3.2.2/json/tray.json new file mode 100644 index 0000000..949e5a5 --- /dev/null +++ b/castholm/v0.1.4-SDL-3.2.2/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.4-SDL-3.2.2/json/video.json b/castholm/v0.1.4-SDL-3.2.2/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.1.4-SDL-3.2.2/json/video.json +++ b/castholm/v0.1.4-SDL-3.2.2/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.1.5-SDL-3.2.4/api/audio.zig b/castholm/v0.1.5-SDL-3.2.4/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/audio.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/blendmode.zig b/castholm/v0.1.5-SDL-3.2.4/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/blendmode.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/c.zig b/castholm/v0.1.5-SDL-3.2.4/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/camera.zig b/castholm/v0.1.5-SDL-3.2.4/api/camera.zig index 5d16142..7a9ccd3 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/camera.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/clipboard.zig b/castholm/v0.1.5-SDL-3.2.4/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/clipboard.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/dialog.zig b/castholm/v0.1.5-SDL-3.2.4/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/dialog.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/error.zig b/castholm/v0.1.5-SDL-3.2.4/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/error.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.1.5-SDL-3.2.4/api/events.zig b/castholm/v0.1.5-SDL-3.2.4/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/events.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/filesystem.zig b/castholm/v0.1.5-SDL-3.2.4/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/filesystem.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/gamepad.zig b/castholm/v0.1.5-SDL-3.2.4/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/gamepad.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/gpu.zig b/castholm/v0.1.5-SDL-3.2.4/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/gpu.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/guid.zig b/castholm/v0.1.5-SDL-3.2.4/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/haptic.zig b/castholm/v0.1.5-SDL-3.2.4/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/haptic.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/hints.zig b/castholm/v0.1.5-SDL-3.2.4/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/hints.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/init.zig b/castholm/v0.1.5-SDL-3.2.4/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/init.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/iostream.zig b/castholm/v0.1.5-SDL-3.2.4/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/joystick.zig b/castholm/v0.1.5-SDL-3.2.4/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/joystick.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/keyboard.zig b/castholm/v0.1.5-SDL-3.2.4/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/keycode.zig b/castholm/v0.1.5-SDL-3.2.4/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/keycode.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/loadso.zig b/castholm/v0.1.5-SDL-3.2.4/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/loadso.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/messagebox.zig b/castholm/v0.1.5-SDL-3.2.4/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/messagebox.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/misc.zig b/castholm/v0.1.5-SDL-3.2.4/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/misc.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/mouse.zig b/castholm/v0.1.5-SDL-3.2.4/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/mouse.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/opengl.zig b/castholm/v0.1.5-SDL-3.2.4/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/pen.zig b/castholm/v0.1.5-SDL-3.2.4/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/pixels.zig b/castholm/v0.1.5-SDL-3.2.4/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/pixels.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/power.zig b/castholm/v0.1.5-SDL-3.2.4/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/process.zig b/castholm/v0.1.5-SDL-3.2.4/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/properties.zig b/castholm/v0.1.5-SDL-3.2.4/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/properties.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/rect.zig b/castholm/v0.1.5-SDL-3.2.4/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/rect.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/render.zig b/castholm/v0.1.5-SDL-3.2.4/api/render.zig index aaad785..0c57be7 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/render.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/scancode.zig b/castholm/v0.1.5-SDL-3.2.4/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/sensor.zig b/castholm/v0.1.5-SDL-3.2.4/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/sensor.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/stdinc.zig b/castholm/v0.1.5-SDL-3.2.4/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.1.5-SDL-3.2.4/api/storage.zig b/castholm/v0.1.5-SDL-3.2.4/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/storage.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/surface.zig b/castholm/v0.1.5-SDL-3.2.4/api/surface.zig index b719a7a..f352ebb 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/surface.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,230 +39,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/system.zig b/castholm/v0.1.5-SDL-3.2.4/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/system.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/time.zig b/castholm/v0.1.5-SDL-3.2.4/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/time.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.1.5-SDL-3.2.4/api/timer.zig b/castholm/v0.1.5-SDL-3.2.4/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/timer.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/touch.zig b/castholm/v0.1.5-SDL-3.2.4/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/touch.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/tray.zig b/castholm/v0.1.5-SDL-3.2.4/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.1.5-SDL-3.2.4/api/version.zig b/castholm/v0.1.5-SDL-3.2.4/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/version.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.1.5-SDL-3.2.4/api/video.zig b/castholm/v0.1.5-SDL-3.2.4/api/video.zig index 9125b0e..e43f76c 100644 --- a/castholm/v0.1.5-SDL-3.2.4/api/video.zig +++ b/castholm/v0.1.5-SDL-3.2.4/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.1.5-SDL-3.2.4/json/audio.json b/castholm/v0.1.5-SDL-3.2.4/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/audio.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.1.5-SDL-3.2.4/json/blendmode.json b/castholm/v0.1.5-SDL-3.2.4/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/blendmode.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.1.5-SDL-3.2.4/json/events.json b/castholm/v0.1.5-SDL-3.2.4/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/events.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.1.5-SDL-3.2.4/json/filesystem.json b/castholm/v0.1.5-SDL-3.2.4/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/filesystem.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.1.5-SDL-3.2.4/json/gamepad.json b/castholm/v0.1.5-SDL-3.2.4/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/gamepad.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.1.5-SDL-3.2.4/json/gpu.json b/castholm/v0.1.5-SDL-3.2.4/json/gpu.json index b1de6d6..a63962c 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/gpu.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.1.5-SDL-3.2.4/json/guid.json b/castholm/v0.1.5-SDL-3.2.4/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/haptic.json b/castholm/v0.1.5-SDL-3.2.4/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/haptic.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.1.5-SDL-3.2.4/json/iostream.json b/castholm/v0.1.5-SDL-3.2.4/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/joystick.json b/castholm/v0.1.5-SDL-3.2.4/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/joystick.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.1.5-SDL-3.2.4/json/keyboard.json b/castholm/v0.1.5-SDL-3.2.4/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/opengl.json b/castholm/v0.1.5-SDL-3.2.4/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/pen.json b/castholm/v0.1.5-SDL-3.2.4/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/pixels.json b/castholm/v0.1.5-SDL-3.2.4/json/pixels.json index 3767023..da971fa 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/pixels.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.1.5-SDL-3.2.4/json/power.json b/castholm/v0.1.5-SDL-3.2.4/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/process.json b/castholm/v0.1.5-SDL-3.2.4/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/scancode.json b/castholm/v0.1.5-SDL-3.2.4/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/system.json b/castholm/v0.1.5-SDL-3.2.4/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/system.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.1.5-SDL-3.2.4/json/touch.json b/castholm/v0.1.5-SDL-3.2.4/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/touch.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.1.5-SDL-3.2.4/json/tray.json b/castholm/v0.1.5-SDL-3.2.4/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.1.5-SDL-3.2.4/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.1.5-SDL-3.2.4/json/video.json b/castholm/v0.1.5-SDL-3.2.4/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.1.5-SDL-3.2.4/json/video.json +++ b/castholm/v0.1.5-SDL-3.2.4/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.0-3.2.8/api/audio.zig b/castholm/v0.2.0-3.2.8/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.0-3.2.8/api/audio.zig +++ b/castholm/v0.2.0-3.2.8/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.0-3.2.8/api/blendmode.zig b/castholm/v0.2.0-3.2.8/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.0-3.2.8/api/blendmode.zig +++ b/castholm/v0.2.0-3.2.8/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.0-3.2.8/api/c.zig b/castholm/v0.2.0-3.2.8/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.0-3.2.8/api/camera.zig b/castholm/v0.2.0-3.2.8/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.0-3.2.8/api/camera.zig +++ b/castholm/v0.2.0-3.2.8/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.0-3.2.8/api/clipboard.zig b/castholm/v0.2.0-3.2.8/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.0-3.2.8/api/clipboard.zig +++ b/castholm/v0.2.0-3.2.8/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.0-3.2.8/api/dialog.zig b/castholm/v0.2.0-3.2.8/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.0-3.2.8/api/dialog.zig +++ b/castholm/v0.2.0-3.2.8/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.0-3.2.8/api/error.zig b/castholm/v0.2.0-3.2.8/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.0-3.2.8/api/error.zig +++ b/castholm/v0.2.0-3.2.8/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.0-3.2.8/api/events.zig b/castholm/v0.2.0-3.2.8/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.2.0-3.2.8/api/events.zig +++ b/castholm/v0.2.0-3.2.8/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.0-3.2.8/api/filesystem.zig b/castholm/v0.2.0-3.2.8/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.0-3.2.8/api/filesystem.zig +++ b/castholm/v0.2.0-3.2.8/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.0-3.2.8/api/gamepad.zig b/castholm/v0.2.0-3.2.8/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.0-3.2.8/api/gamepad.zig +++ b/castholm/v0.2.0-3.2.8/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.0-3.2.8/api/gpu.zig b/castholm/v0.2.0-3.2.8/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.0-3.2.8/api/gpu.zig +++ b/castholm/v0.2.0-3.2.8/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.0-3.2.8/api/guid.zig b/castholm/v0.2.0-3.2.8/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.0-3.2.8/api/haptic.zig b/castholm/v0.2.0-3.2.8/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.0-3.2.8/api/haptic.zig +++ b/castholm/v0.2.0-3.2.8/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.0-3.2.8/api/hints.zig b/castholm/v0.2.0-3.2.8/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.0-3.2.8/api/hints.zig +++ b/castholm/v0.2.0-3.2.8/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.0-3.2.8/api/init.zig b/castholm/v0.2.0-3.2.8/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.2.0-3.2.8/api/init.zig +++ b/castholm/v0.2.0-3.2.8/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.0-3.2.8/api/iostream.zig b/castholm/v0.2.0-3.2.8/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.0-3.2.8/api/joystick.zig b/castholm/v0.2.0-3.2.8/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.0-3.2.8/api/joystick.zig +++ b/castholm/v0.2.0-3.2.8/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.0-3.2.8/api/keyboard.zig b/castholm/v0.2.0-3.2.8/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.0-3.2.8/api/keycode.zig b/castholm/v0.2.0-3.2.8/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.0-3.2.8/api/keycode.zig +++ b/castholm/v0.2.0-3.2.8/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.0-3.2.8/api/loadso.zig b/castholm/v0.2.0-3.2.8/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.0-3.2.8/api/loadso.zig +++ b/castholm/v0.2.0-3.2.8/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.0-3.2.8/api/messagebox.zig b/castholm/v0.2.0-3.2.8/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.0-3.2.8/api/messagebox.zig +++ b/castholm/v0.2.0-3.2.8/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.0-3.2.8/api/misc.zig b/castholm/v0.2.0-3.2.8/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.0-3.2.8/api/misc.zig +++ b/castholm/v0.2.0-3.2.8/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.0-3.2.8/api/mouse.zig b/castholm/v0.2.0-3.2.8/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.0-3.2.8/api/mouse.zig +++ b/castholm/v0.2.0-3.2.8/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.0-3.2.8/api/opengl.zig b/castholm/v0.2.0-3.2.8/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.0-3.2.8/api/pen.zig b/castholm/v0.2.0-3.2.8/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.0-3.2.8/api/pixels.zig b/castholm/v0.2.0-3.2.8/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.0-3.2.8/api/pixels.zig +++ b/castholm/v0.2.0-3.2.8/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.0-3.2.8/api/power.zig b/castholm/v0.2.0-3.2.8/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.0-3.2.8/api/process.zig b/castholm/v0.2.0-3.2.8/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.0-3.2.8/api/properties.zig b/castholm/v0.2.0-3.2.8/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.0-3.2.8/api/properties.zig +++ b/castholm/v0.2.0-3.2.8/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.0-3.2.8/api/rect.zig b/castholm/v0.2.0-3.2.8/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.0-3.2.8/api/rect.zig +++ b/castholm/v0.2.0-3.2.8/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.0-3.2.8/api/render.zig b/castholm/v0.2.0-3.2.8/api/render.zig index 13eefa3..0c57be7 100644 --- a/castholm/v0.2.0-3.2.8/api/render.zig +++ b/castholm/v0.2.0-3.2.8/api/render.zig @@ -1,792 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -811,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1146,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.0-3.2.8/api/scancode.zig b/castholm/v0.2.0-3.2.8/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.0-3.2.8/api/sensor.zig b/castholm/v0.2.0-3.2.8/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.0-3.2.8/api/sensor.zig +++ b/castholm/v0.2.0-3.2.8/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.0-3.2.8/api/stdinc.zig b/castholm/v0.2.0-3.2.8/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.0-3.2.8/api/storage.zig b/castholm/v0.2.0-3.2.8/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.0-3.2.8/api/storage.zig +++ b/castholm/v0.2.0-3.2.8/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.0-3.2.8/api/surface.zig b/castholm/v0.2.0-3.2.8/api/surface.zig index 1b61561..f352ebb 100644 --- a/castholm/v0.2.0-3.2.8/api/surface.zig +++ b/castholm/v0.2.0-3.2.8/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -99,230 +39,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.0-3.2.8/api/system.zig b/castholm/v0.2.0-3.2.8/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.0-3.2.8/api/system.zig +++ b/castholm/v0.2.0-3.2.8/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.0-3.2.8/api/time.zig b/castholm/v0.2.0-3.2.8/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.0-3.2.8/api/time.zig +++ b/castholm/v0.2.0-3.2.8/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.0-3.2.8/api/timer.zig b/castholm/v0.2.0-3.2.8/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.0-3.2.8/api/timer.zig +++ b/castholm/v0.2.0-3.2.8/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.0-3.2.8/api/touch.zig b/castholm/v0.2.0-3.2.8/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.0-3.2.8/api/touch.zig +++ b/castholm/v0.2.0-3.2.8/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.0-3.2.8/api/tray.zig b/castholm/v0.2.0-3.2.8/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.0-3.2.8/api/version.zig b/castholm/v0.2.0-3.2.8/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.0-3.2.8/api/version.zig +++ b/castholm/v0.2.0-3.2.8/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.0-3.2.8/api/video.zig b/castholm/v0.2.0-3.2.8/api/video.zig index 9fa1e06..e43f76c 100644 --- a/castholm/v0.2.0-3.2.8/api/video.zig +++ b/castholm/v0.2.0-3.2.8/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.0-3.2.8/json/audio.json b/castholm/v0.2.0-3.2.8/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.0-3.2.8/json/audio.json +++ b/castholm/v0.2.0-3.2.8/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.0-3.2.8/json/blendmode.json b/castholm/v0.2.0-3.2.8/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.0-3.2.8/json/blendmode.json +++ b/castholm/v0.2.0-3.2.8/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.0-3.2.8/json/events.json b/castholm/v0.2.0-3.2.8/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.2.0-3.2.8/json/events.json +++ b/castholm/v0.2.0-3.2.8/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.0-3.2.8/json/filesystem.json b/castholm/v0.2.0-3.2.8/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.0-3.2.8/json/filesystem.json +++ b/castholm/v0.2.0-3.2.8/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.0-3.2.8/json/gamepad.json b/castholm/v0.2.0-3.2.8/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.0-3.2.8/json/gamepad.json +++ b/castholm/v0.2.0-3.2.8/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.0-3.2.8/json/gpu.json b/castholm/v0.2.0-3.2.8/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.0-3.2.8/json/gpu.json +++ b/castholm/v0.2.0-3.2.8/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.0-3.2.8/json/guid.json b/castholm/v0.2.0-3.2.8/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/haptic.json b/castholm/v0.2.0-3.2.8/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.0-3.2.8/json/haptic.json +++ b/castholm/v0.2.0-3.2.8/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.0-3.2.8/json/iostream.json b/castholm/v0.2.0-3.2.8/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/joystick.json b/castholm/v0.2.0-3.2.8/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.0-3.2.8/json/joystick.json +++ b/castholm/v0.2.0-3.2.8/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.0-3.2.8/json/keyboard.json b/castholm/v0.2.0-3.2.8/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/opengl.json b/castholm/v0.2.0-3.2.8/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/pen.json b/castholm/v0.2.0-3.2.8/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/pixels.json b/castholm/v0.2.0-3.2.8/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.0-3.2.8/json/pixels.json +++ b/castholm/v0.2.0-3.2.8/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.0-3.2.8/json/power.json b/castholm/v0.2.0-3.2.8/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/process.json b/castholm/v0.2.0-3.2.8/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/scancode.json b/castholm/v0.2.0-3.2.8/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/system.json b/castholm/v0.2.0-3.2.8/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.0-3.2.8/json/system.json +++ b/castholm/v0.2.0-3.2.8/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.0-3.2.8/json/touch.json b/castholm/v0.2.0-3.2.8/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.0-3.2.8/json/touch.json +++ b/castholm/v0.2.0-3.2.8/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.0-3.2.8/json/tray.json b/castholm/v0.2.0-3.2.8/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.0-3.2.8/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.0-3.2.8/json/video.json b/castholm/v0.2.0-3.2.8/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.2.0-3.2.8/json/video.json +++ b/castholm/v0.2.0-3.2.8/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.1-3.2.10/api/audio.zig b/castholm/v0.2.1-3.2.10/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.1-3.2.10/api/audio.zig +++ b/castholm/v0.2.1-3.2.10/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.1-3.2.10/api/blendmode.zig b/castholm/v0.2.1-3.2.10/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.1-3.2.10/api/blendmode.zig +++ b/castholm/v0.2.1-3.2.10/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.1-3.2.10/api/c.zig b/castholm/v0.2.1-3.2.10/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.1-3.2.10/api/camera.zig b/castholm/v0.2.1-3.2.10/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.1-3.2.10/api/camera.zig +++ b/castholm/v0.2.1-3.2.10/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.1-3.2.10/api/clipboard.zig b/castholm/v0.2.1-3.2.10/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.1-3.2.10/api/clipboard.zig +++ b/castholm/v0.2.1-3.2.10/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.1-3.2.10/api/dialog.zig b/castholm/v0.2.1-3.2.10/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.1-3.2.10/api/dialog.zig +++ b/castholm/v0.2.1-3.2.10/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.1-3.2.10/api/error.zig b/castholm/v0.2.1-3.2.10/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.1-3.2.10/api/error.zig +++ b/castholm/v0.2.1-3.2.10/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.1-3.2.10/api/events.zig b/castholm/v0.2.1-3.2.10/api/events.zig index e6ece5d..d1227c3 100644 --- a/castholm/v0.2.1-3.2.10/api/events.zig +++ b/castholm/v0.2.1-3.2.10/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.1-3.2.10/api/filesystem.zig b/castholm/v0.2.1-3.2.10/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.1-3.2.10/api/filesystem.zig +++ b/castholm/v0.2.1-3.2.10/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.1-3.2.10/api/gamepad.zig b/castholm/v0.2.1-3.2.10/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.1-3.2.10/api/gamepad.zig +++ b/castholm/v0.2.1-3.2.10/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.1-3.2.10/api/gpu.zig b/castholm/v0.2.1-3.2.10/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.1-3.2.10/api/gpu.zig +++ b/castholm/v0.2.1-3.2.10/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.1-3.2.10/api/guid.zig b/castholm/v0.2.1-3.2.10/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.1-3.2.10/api/haptic.zig b/castholm/v0.2.1-3.2.10/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.1-3.2.10/api/haptic.zig +++ b/castholm/v0.2.1-3.2.10/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.1-3.2.10/api/hints.zig b/castholm/v0.2.1-3.2.10/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.1-3.2.10/api/hints.zig +++ b/castholm/v0.2.1-3.2.10/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.1-3.2.10/api/init.zig b/castholm/v0.2.1-3.2.10/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.2.1-3.2.10/api/init.zig +++ b/castholm/v0.2.1-3.2.10/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.1-3.2.10/api/iostream.zig b/castholm/v0.2.1-3.2.10/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.1-3.2.10/api/joystick.zig b/castholm/v0.2.1-3.2.10/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.1-3.2.10/api/joystick.zig +++ b/castholm/v0.2.1-3.2.10/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.1-3.2.10/api/keyboard.zig b/castholm/v0.2.1-3.2.10/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.1-3.2.10/api/keycode.zig b/castholm/v0.2.1-3.2.10/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.1-3.2.10/api/keycode.zig +++ b/castholm/v0.2.1-3.2.10/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.1-3.2.10/api/loadso.zig b/castholm/v0.2.1-3.2.10/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.1-3.2.10/api/loadso.zig +++ b/castholm/v0.2.1-3.2.10/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.1-3.2.10/api/messagebox.zig b/castholm/v0.2.1-3.2.10/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.1-3.2.10/api/messagebox.zig +++ b/castholm/v0.2.1-3.2.10/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.1-3.2.10/api/misc.zig b/castholm/v0.2.1-3.2.10/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.1-3.2.10/api/misc.zig +++ b/castholm/v0.2.1-3.2.10/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.1-3.2.10/api/mouse.zig b/castholm/v0.2.1-3.2.10/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.1-3.2.10/api/mouse.zig +++ b/castholm/v0.2.1-3.2.10/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.1-3.2.10/api/opengl.zig b/castholm/v0.2.1-3.2.10/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.1-3.2.10/api/pen.zig b/castholm/v0.2.1-3.2.10/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.1-3.2.10/api/pixels.zig b/castholm/v0.2.1-3.2.10/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.1-3.2.10/api/pixels.zig +++ b/castholm/v0.2.1-3.2.10/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.1-3.2.10/api/power.zig b/castholm/v0.2.1-3.2.10/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.1-3.2.10/api/process.zig b/castholm/v0.2.1-3.2.10/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.1-3.2.10/api/properties.zig b/castholm/v0.2.1-3.2.10/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.1-3.2.10/api/properties.zig +++ b/castholm/v0.2.1-3.2.10/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.1-3.2.10/api/rect.zig b/castholm/v0.2.1-3.2.10/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.1-3.2.10/api/rect.zig +++ b/castholm/v0.2.1-3.2.10/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.1-3.2.10/api/render.zig b/castholm/v0.2.1-3.2.10/api/render.zig index 13eefa3..0c57be7 100644 --- a/castholm/v0.2.1-3.2.10/api/render.zig +++ b/castholm/v0.2.1-3.2.10/api/render.zig @@ -1,792 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -811,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1146,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.1-3.2.10/api/scancode.zig b/castholm/v0.2.1-3.2.10/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.1-3.2.10/api/sensor.zig b/castholm/v0.2.1-3.2.10/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.1-3.2.10/api/sensor.zig +++ b/castholm/v0.2.1-3.2.10/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.1-3.2.10/api/stdinc.zig b/castholm/v0.2.1-3.2.10/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.1-3.2.10/api/storage.zig b/castholm/v0.2.1-3.2.10/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.1-3.2.10/api/storage.zig +++ b/castholm/v0.2.1-3.2.10/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.1-3.2.10/api/surface.zig b/castholm/v0.2.1-3.2.10/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.1-3.2.10/api/surface.zig +++ b/castholm/v0.2.1-3.2.10/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.1-3.2.10/api/system.zig b/castholm/v0.2.1-3.2.10/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.1-3.2.10/api/system.zig +++ b/castholm/v0.2.1-3.2.10/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.1-3.2.10/api/time.zig b/castholm/v0.2.1-3.2.10/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.1-3.2.10/api/time.zig +++ b/castholm/v0.2.1-3.2.10/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.1-3.2.10/api/timer.zig b/castholm/v0.2.1-3.2.10/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.1-3.2.10/api/timer.zig +++ b/castholm/v0.2.1-3.2.10/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.1-3.2.10/api/touch.zig b/castholm/v0.2.1-3.2.10/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.1-3.2.10/api/touch.zig +++ b/castholm/v0.2.1-3.2.10/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.1-3.2.10/api/tray.zig b/castholm/v0.2.1-3.2.10/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.1-3.2.10/api/version.zig b/castholm/v0.2.1-3.2.10/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.1-3.2.10/api/version.zig +++ b/castholm/v0.2.1-3.2.10/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.1-3.2.10/api/video.zig b/castholm/v0.2.1-3.2.10/api/video.zig index 9fa1e06..e43f76c 100644 --- a/castholm/v0.2.1-3.2.10/api/video.zig +++ b/castholm/v0.2.1-3.2.10/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.1-3.2.10/json/audio.json b/castholm/v0.2.1-3.2.10/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.1-3.2.10/json/audio.json +++ b/castholm/v0.2.1-3.2.10/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.1-3.2.10/json/blendmode.json b/castholm/v0.2.1-3.2.10/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.1-3.2.10/json/blendmode.json +++ b/castholm/v0.2.1-3.2.10/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.1-3.2.10/json/events.json b/castholm/v0.2.1-3.2.10/json/events.json index acc1421..05b35df 100644 --- a/castholm/v0.2.1-3.2.10/json/events.json +++ b/castholm/v0.2.1-3.2.10/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.1-3.2.10/json/filesystem.json b/castholm/v0.2.1-3.2.10/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.1-3.2.10/json/filesystem.json +++ b/castholm/v0.2.1-3.2.10/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.1-3.2.10/json/gamepad.json b/castholm/v0.2.1-3.2.10/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.1-3.2.10/json/gamepad.json +++ b/castholm/v0.2.1-3.2.10/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.1-3.2.10/json/gpu.json b/castholm/v0.2.1-3.2.10/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.1-3.2.10/json/gpu.json +++ b/castholm/v0.2.1-3.2.10/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.1-3.2.10/json/guid.json b/castholm/v0.2.1-3.2.10/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/haptic.json b/castholm/v0.2.1-3.2.10/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.1-3.2.10/json/haptic.json +++ b/castholm/v0.2.1-3.2.10/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.1-3.2.10/json/iostream.json b/castholm/v0.2.1-3.2.10/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/joystick.json b/castholm/v0.2.1-3.2.10/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.1-3.2.10/json/joystick.json +++ b/castholm/v0.2.1-3.2.10/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.1-3.2.10/json/keyboard.json b/castholm/v0.2.1-3.2.10/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/opengl.json b/castholm/v0.2.1-3.2.10/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/pen.json b/castholm/v0.2.1-3.2.10/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/pixels.json b/castholm/v0.2.1-3.2.10/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.1-3.2.10/json/pixels.json +++ b/castholm/v0.2.1-3.2.10/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.1-3.2.10/json/power.json b/castholm/v0.2.1-3.2.10/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/process.json b/castholm/v0.2.1-3.2.10/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/scancode.json b/castholm/v0.2.1-3.2.10/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/surface.json b/castholm/v0.2.1-3.2.10/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.1-3.2.10/json/surface.json +++ b/castholm/v0.2.1-3.2.10/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.1-3.2.10/json/system.json b/castholm/v0.2.1-3.2.10/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.1-3.2.10/json/system.json +++ b/castholm/v0.2.1-3.2.10/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.1-3.2.10/json/touch.json b/castholm/v0.2.1-3.2.10/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.1-3.2.10/json/touch.json +++ b/castholm/v0.2.1-3.2.10/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.1-3.2.10/json/tray.json b/castholm/v0.2.1-3.2.10/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.1-3.2.10/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.1-3.2.10/json/video.json b/castholm/v0.2.1-3.2.10/json/video.json index a9e23a5..b713b22 100644 --- a/castholm/v0.2.1-3.2.10/json/video.json +++ b/castholm/v0.2.1-3.2.10/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.2-3.2.12/api/audio.zig b/castholm/v0.2.2-3.2.12/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.2-3.2.12/api/audio.zig +++ b/castholm/v0.2.2-3.2.12/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.2-3.2.12/api/blendmode.zig b/castholm/v0.2.2-3.2.12/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.2-3.2.12/api/blendmode.zig +++ b/castholm/v0.2.2-3.2.12/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.2-3.2.12/api/c.zig b/castholm/v0.2.2-3.2.12/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.2-3.2.12/api/camera.zig b/castholm/v0.2.2-3.2.12/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.2-3.2.12/api/camera.zig +++ b/castholm/v0.2.2-3.2.12/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.2-3.2.12/api/clipboard.zig b/castholm/v0.2.2-3.2.12/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.2-3.2.12/api/clipboard.zig +++ b/castholm/v0.2.2-3.2.12/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.2-3.2.12/api/dialog.zig b/castholm/v0.2.2-3.2.12/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.2-3.2.12/api/dialog.zig +++ b/castholm/v0.2.2-3.2.12/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.2-3.2.12/api/error.zig b/castholm/v0.2.2-3.2.12/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.2-3.2.12/api/error.zig +++ b/castholm/v0.2.2-3.2.12/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.2-3.2.12/api/events.zig b/castholm/v0.2.2-3.2.12/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.2.2-3.2.12/api/events.zig +++ b/castholm/v0.2.2-3.2.12/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.2-3.2.12/api/filesystem.zig b/castholm/v0.2.2-3.2.12/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.2-3.2.12/api/filesystem.zig +++ b/castholm/v0.2.2-3.2.12/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.2-3.2.12/api/gamepad.zig b/castholm/v0.2.2-3.2.12/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.2-3.2.12/api/gamepad.zig +++ b/castholm/v0.2.2-3.2.12/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.2-3.2.12/api/gpu.zig b/castholm/v0.2.2-3.2.12/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.2-3.2.12/api/gpu.zig +++ b/castholm/v0.2.2-3.2.12/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.2-3.2.12/api/guid.zig b/castholm/v0.2.2-3.2.12/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.2-3.2.12/api/haptic.zig b/castholm/v0.2.2-3.2.12/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.2-3.2.12/api/haptic.zig +++ b/castholm/v0.2.2-3.2.12/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.2-3.2.12/api/hints.zig b/castholm/v0.2.2-3.2.12/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.2-3.2.12/api/hints.zig +++ b/castholm/v0.2.2-3.2.12/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.2-3.2.12/api/init.zig b/castholm/v0.2.2-3.2.12/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.2.2-3.2.12/api/init.zig +++ b/castholm/v0.2.2-3.2.12/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.2-3.2.12/api/iostream.zig b/castholm/v0.2.2-3.2.12/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.2-3.2.12/api/joystick.zig b/castholm/v0.2.2-3.2.12/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.2-3.2.12/api/joystick.zig +++ b/castholm/v0.2.2-3.2.12/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.2-3.2.12/api/keyboard.zig b/castholm/v0.2.2-3.2.12/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.2-3.2.12/api/keycode.zig b/castholm/v0.2.2-3.2.12/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.2-3.2.12/api/keycode.zig +++ b/castholm/v0.2.2-3.2.12/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.2-3.2.12/api/loadso.zig b/castholm/v0.2.2-3.2.12/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.2-3.2.12/api/loadso.zig +++ b/castholm/v0.2.2-3.2.12/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.2-3.2.12/api/messagebox.zig b/castholm/v0.2.2-3.2.12/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.2-3.2.12/api/messagebox.zig +++ b/castholm/v0.2.2-3.2.12/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.2-3.2.12/api/misc.zig b/castholm/v0.2.2-3.2.12/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.2-3.2.12/api/misc.zig +++ b/castholm/v0.2.2-3.2.12/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.2-3.2.12/api/mouse.zig b/castholm/v0.2.2-3.2.12/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.2-3.2.12/api/mouse.zig +++ b/castholm/v0.2.2-3.2.12/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.2-3.2.12/api/opengl.zig b/castholm/v0.2.2-3.2.12/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.2-3.2.12/api/pen.zig b/castholm/v0.2.2-3.2.12/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.2-3.2.12/api/pixels.zig b/castholm/v0.2.2-3.2.12/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.2-3.2.12/api/pixels.zig +++ b/castholm/v0.2.2-3.2.12/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.2-3.2.12/api/power.zig b/castholm/v0.2.2-3.2.12/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.2-3.2.12/api/process.zig b/castholm/v0.2.2-3.2.12/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.2-3.2.12/api/properties.zig b/castholm/v0.2.2-3.2.12/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.2-3.2.12/api/properties.zig +++ b/castholm/v0.2.2-3.2.12/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.2-3.2.12/api/rect.zig b/castholm/v0.2.2-3.2.12/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.2-3.2.12/api/rect.zig +++ b/castholm/v0.2.2-3.2.12/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.2-3.2.12/api/render.zig b/castholm/v0.2.2-3.2.12/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.2.2-3.2.12/api/render.zig +++ b/castholm/v0.2.2-3.2.12/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.2-3.2.12/api/scancode.zig b/castholm/v0.2.2-3.2.12/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.2-3.2.12/api/sensor.zig b/castholm/v0.2.2-3.2.12/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.2-3.2.12/api/sensor.zig +++ b/castholm/v0.2.2-3.2.12/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.2-3.2.12/api/stdinc.zig b/castholm/v0.2.2-3.2.12/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.2-3.2.12/api/storage.zig b/castholm/v0.2.2-3.2.12/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.2-3.2.12/api/storage.zig +++ b/castholm/v0.2.2-3.2.12/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.2-3.2.12/api/surface.zig b/castholm/v0.2.2-3.2.12/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.2-3.2.12/api/surface.zig +++ b/castholm/v0.2.2-3.2.12/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.2-3.2.12/api/system.zig b/castholm/v0.2.2-3.2.12/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.2-3.2.12/api/system.zig +++ b/castholm/v0.2.2-3.2.12/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.2-3.2.12/api/time.zig b/castholm/v0.2.2-3.2.12/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.2-3.2.12/api/time.zig +++ b/castholm/v0.2.2-3.2.12/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.2-3.2.12/api/timer.zig b/castholm/v0.2.2-3.2.12/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.2-3.2.12/api/timer.zig +++ b/castholm/v0.2.2-3.2.12/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.2-3.2.12/api/touch.zig b/castholm/v0.2.2-3.2.12/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.2-3.2.12/api/touch.zig +++ b/castholm/v0.2.2-3.2.12/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.2-3.2.12/api/tray.zig b/castholm/v0.2.2-3.2.12/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.2-3.2.12/api/version.zig b/castholm/v0.2.2-3.2.12/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.2-3.2.12/api/version.zig +++ b/castholm/v0.2.2-3.2.12/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.2-3.2.12/api/video.zig b/castholm/v0.2.2-3.2.12/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.2.2-3.2.12/api/video.zig +++ b/castholm/v0.2.2-3.2.12/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.2-3.2.12/json/audio.json b/castholm/v0.2.2-3.2.12/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.2-3.2.12/json/audio.json +++ b/castholm/v0.2.2-3.2.12/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.2-3.2.12/json/blendmode.json b/castholm/v0.2.2-3.2.12/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.2-3.2.12/json/blendmode.json +++ b/castholm/v0.2.2-3.2.12/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.2-3.2.12/json/events.json b/castholm/v0.2.2-3.2.12/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.2.2-3.2.12/json/events.json +++ b/castholm/v0.2.2-3.2.12/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.2-3.2.12/json/filesystem.json b/castholm/v0.2.2-3.2.12/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.2-3.2.12/json/filesystem.json +++ b/castholm/v0.2.2-3.2.12/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.2-3.2.12/json/gamepad.json b/castholm/v0.2.2-3.2.12/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.2-3.2.12/json/gamepad.json +++ b/castholm/v0.2.2-3.2.12/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.2-3.2.12/json/gpu.json b/castholm/v0.2.2-3.2.12/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.2-3.2.12/json/gpu.json +++ b/castholm/v0.2.2-3.2.12/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.2-3.2.12/json/guid.json b/castholm/v0.2.2-3.2.12/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/haptic.json b/castholm/v0.2.2-3.2.12/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.2-3.2.12/json/haptic.json +++ b/castholm/v0.2.2-3.2.12/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.2-3.2.12/json/iostream.json b/castholm/v0.2.2-3.2.12/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/joystick.json b/castholm/v0.2.2-3.2.12/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.2-3.2.12/json/joystick.json +++ b/castholm/v0.2.2-3.2.12/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.2-3.2.12/json/keyboard.json b/castholm/v0.2.2-3.2.12/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/opengl.json b/castholm/v0.2.2-3.2.12/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/pen.json b/castholm/v0.2.2-3.2.12/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/pixels.json b/castholm/v0.2.2-3.2.12/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.2-3.2.12/json/pixels.json +++ b/castholm/v0.2.2-3.2.12/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.2-3.2.12/json/power.json b/castholm/v0.2.2-3.2.12/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/process.json b/castholm/v0.2.2-3.2.12/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/scancode.json b/castholm/v0.2.2-3.2.12/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/surface.json b/castholm/v0.2.2-3.2.12/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.2-3.2.12/json/surface.json +++ b/castholm/v0.2.2-3.2.12/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.2-3.2.12/json/system.json b/castholm/v0.2.2-3.2.12/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.2-3.2.12/json/system.json +++ b/castholm/v0.2.2-3.2.12/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.2-3.2.12/json/touch.json b/castholm/v0.2.2-3.2.12/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.2-3.2.12/json/touch.json +++ b/castholm/v0.2.2-3.2.12/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.2-3.2.12/json/tray.json b/castholm/v0.2.2-3.2.12/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.2-3.2.12/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.2-3.2.12/json/video.json b/castholm/v0.2.2-3.2.12/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.2.2-3.2.12/json/video.json +++ b/castholm/v0.2.2-3.2.12/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.3-3.2.14/api/audio.zig b/castholm/v0.2.3-3.2.14/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.3-3.2.14/api/audio.zig +++ b/castholm/v0.2.3-3.2.14/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.3-3.2.14/api/blendmode.zig b/castholm/v0.2.3-3.2.14/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.3-3.2.14/api/blendmode.zig +++ b/castholm/v0.2.3-3.2.14/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.3-3.2.14/api/c.zig b/castholm/v0.2.3-3.2.14/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.3-3.2.14/api/camera.zig b/castholm/v0.2.3-3.2.14/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.3-3.2.14/api/camera.zig +++ b/castholm/v0.2.3-3.2.14/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.3-3.2.14/api/clipboard.zig b/castholm/v0.2.3-3.2.14/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.3-3.2.14/api/clipboard.zig +++ b/castholm/v0.2.3-3.2.14/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.3-3.2.14/api/dialog.zig b/castholm/v0.2.3-3.2.14/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.3-3.2.14/api/dialog.zig +++ b/castholm/v0.2.3-3.2.14/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.3-3.2.14/api/error.zig b/castholm/v0.2.3-3.2.14/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.3-3.2.14/api/error.zig +++ b/castholm/v0.2.3-3.2.14/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.3-3.2.14/api/events.zig b/castholm/v0.2.3-3.2.14/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.2.3-3.2.14/api/events.zig +++ b/castholm/v0.2.3-3.2.14/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.3-3.2.14/api/filesystem.zig b/castholm/v0.2.3-3.2.14/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.3-3.2.14/api/filesystem.zig +++ b/castholm/v0.2.3-3.2.14/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.3-3.2.14/api/gamepad.zig b/castholm/v0.2.3-3.2.14/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.3-3.2.14/api/gamepad.zig +++ b/castholm/v0.2.3-3.2.14/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.3-3.2.14/api/gpu.zig b/castholm/v0.2.3-3.2.14/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.3-3.2.14/api/gpu.zig +++ b/castholm/v0.2.3-3.2.14/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.3-3.2.14/api/guid.zig b/castholm/v0.2.3-3.2.14/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.3-3.2.14/api/haptic.zig b/castholm/v0.2.3-3.2.14/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.3-3.2.14/api/haptic.zig +++ b/castholm/v0.2.3-3.2.14/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.3-3.2.14/api/hints.zig b/castholm/v0.2.3-3.2.14/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.3-3.2.14/api/hints.zig +++ b/castholm/v0.2.3-3.2.14/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.3-3.2.14/api/init.zig b/castholm/v0.2.3-3.2.14/api/init.zig index b568c23..0be8c92 100644 --- a/castholm/v0.2.3-3.2.14/api/init.zig +++ b/castholm/v0.2.3-3.2.14/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.3-3.2.14/api/iostream.zig b/castholm/v0.2.3-3.2.14/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.3-3.2.14/api/joystick.zig b/castholm/v0.2.3-3.2.14/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.3-3.2.14/api/joystick.zig +++ b/castholm/v0.2.3-3.2.14/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.3-3.2.14/api/keyboard.zig b/castholm/v0.2.3-3.2.14/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.3-3.2.14/api/keycode.zig b/castholm/v0.2.3-3.2.14/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.3-3.2.14/api/keycode.zig +++ b/castholm/v0.2.3-3.2.14/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.3-3.2.14/api/loadso.zig b/castholm/v0.2.3-3.2.14/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.3-3.2.14/api/loadso.zig +++ b/castholm/v0.2.3-3.2.14/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.3-3.2.14/api/messagebox.zig b/castholm/v0.2.3-3.2.14/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.3-3.2.14/api/messagebox.zig +++ b/castholm/v0.2.3-3.2.14/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.3-3.2.14/api/misc.zig b/castholm/v0.2.3-3.2.14/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.3-3.2.14/api/misc.zig +++ b/castholm/v0.2.3-3.2.14/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.3-3.2.14/api/mouse.zig b/castholm/v0.2.3-3.2.14/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.3-3.2.14/api/mouse.zig +++ b/castholm/v0.2.3-3.2.14/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.3-3.2.14/api/opengl.zig b/castholm/v0.2.3-3.2.14/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.3-3.2.14/api/pen.zig b/castholm/v0.2.3-3.2.14/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.3-3.2.14/api/pixels.zig b/castholm/v0.2.3-3.2.14/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.3-3.2.14/api/pixels.zig +++ b/castholm/v0.2.3-3.2.14/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.3-3.2.14/api/power.zig b/castholm/v0.2.3-3.2.14/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.3-3.2.14/api/process.zig b/castholm/v0.2.3-3.2.14/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.3-3.2.14/api/properties.zig b/castholm/v0.2.3-3.2.14/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.3-3.2.14/api/properties.zig +++ b/castholm/v0.2.3-3.2.14/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.3-3.2.14/api/rect.zig b/castholm/v0.2.3-3.2.14/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.3-3.2.14/api/rect.zig +++ b/castholm/v0.2.3-3.2.14/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.3-3.2.14/api/render.zig b/castholm/v0.2.3-3.2.14/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.2.3-3.2.14/api/render.zig +++ b/castholm/v0.2.3-3.2.14/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.3-3.2.14/api/scancode.zig b/castholm/v0.2.3-3.2.14/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.3-3.2.14/api/sensor.zig b/castholm/v0.2.3-3.2.14/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.3-3.2.14/api/sensor.zig +++ b/castholm/v0.2.3-3.2.14/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.3-3.2.14/api/stdinc.zig b/castholm/v0.2.3-3.2.14/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.3-3.2.14/api/storage.zig b/castholm/v0.2.3-3.2.14/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.3-3.2.14/api/storage.zig +++ b/castholm/v0.2.3-3.2.14/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.3-3.2.14/api/surface.zig b/castholm/v0.2.3-3.2.14/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.3-3.2.14/api/surface.zig +++ b/castholm/v0.2.3-3.2.14/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.3-3.2.14/api/system.zig b/castholm/v0.2.3-3.2.14/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.3-3.2.14/api/system.zig +++ b/castholm/v0.2.3-3.2.14/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.3-3.2.14/api/time.zig b/castholm/v0.2.3-3.2.14/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.3-3.2.14/api/time.zig +++ b/castholm/v0.2.3-3.2.14/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.3-3.2.14/api/timer.zig b/castholm/v0.2.3-3.2.14/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.3-3.2.14/api/timer.zig +++ b/castholm/v0.2.3-3.2.14/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.3-3.2.14/api/touch.zig b/castholm/v0.2.3-3.2.14/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.3-3.2.14/api/touch.zig +++ b/castholm/v0.2.3-3.2.14/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.3-3.2.14/api/tray.zig b/castholm/v0.2.3-3.2.14/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.3-3.2.14/api/version.zig b/castholm/v0.2.3-3.2.14/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.3-3.2.14/api/version.zig +++ b/castholm/v0.2.3-3.2.14/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.3-3.2.14/api/video.zig b/castholm/v0.2.3-3.2.14/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.2.3-3.2.14/api/video.zig +++ b/castholm/v0.2.3-3.2.14/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.3-3.2.14/json/audio.json b/castholm/v0.2.3-3.2.14/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.3-3.2.14/json/audio.json +++ b/castholm/v0.2.3-3.2.14/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.3-3.2.14/json/blendmode.json b/castholm/v0.2.3-3.2.14/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.3-3.2.14/json/blendmode.json +++ b/castholm/v0.2.3-3.2.14/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.3-3.2.14/json/events.json b/castholm/v0.2.3-3.2.14/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.2.3-3.2.14/json/events.json +++ b/castholm/v0.2.3-3.2.14/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.3-3.2.14/json/filesystem.json b/castholm/v0.2.3-3.2.14/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.3-3.2.14/json/filesystem.json +++ b/castholm/v0.2.3-3.2.14/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.3-3.2.14/json/gamepad.json b/castholm/v0.2.3-3.2.14/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.3-3.2.14/json/gamepad.json +++ b/castholm/v0.2.3-3.2.14/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.3-3.2.14/json/gpu.json b/castholm/v0.2.3-3.2.14/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.3-3.2.14/json/gpu.json +++ b/castholm/v0.2.3-3.2.14/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.3-3.2.14/json/guid.json b/castholm/v0.2.3-3.2.14/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/haptic.json b/castholm/v0.2.3-3.2.14/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.3-3.2.14/json/haptic.json +++ b/castholm/v0.2.3-3.2.14/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.3-3.2.14/json/iostream.json b/castholm/v0.2.3-3.2.14/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/joystick.json b/castholm/v0.2.3-3.2.14/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.3-3.2.14/json/joystick.json +++ b/castholm/v0.2.3-3.2.14/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.3-3.2.14/json/keyboard.json b/castholm/v0.2.3-3.2.14/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/opengl.json b/castholm/v0.2.3-3.2.14/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/pen.json b/castholm/v0.2.3-3.2.14/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/pixels.json b/castholm/v0.2.3-3.2.14/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.3-3.2.14/json/pixels.json +++ b/castholm/v0.2.3-3.2.14/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.3-3.2.14/json/power.json b/castholm/v0.2.3-3.2.14/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/process.json b/castholm/v0.2.3-3.2.14/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/scancode.json b/castholm/v0.2.3-3.2.14/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/surface.json b/castholm/v0.2.3-3.2.14/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.3-3.2.14/json/surface.json +++ b/castholm/v0.2.3-3.2.14/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.3-3.2.14/json/system.json b/castholm/v0.2.3-3.2.14/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.3-3.2.14/json/system.json +++ b/castholm/v0.2.3-3.2.14/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.3-3.2.14/json/touch.json b/castholm/v0.2.3-3.2.14/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.3-3.2.14/json/touch.json +++ b/castholm/v0.2.3-3.2.14/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.3-3.2.14/json/tray.json b/castholm/v0.2.3-3.2.14/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.3-3.2.14/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.3-3.2.14/json/video.json b/castholm/v0.2.3-3.2.14/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.2.3-3.2.14/json/video.json +++ b/castholm/v0.2.3-3.2.14/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.4-3.2.16/api/audio.zig b/castholm/v0.2.4-3.2.16/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.4-3.2.16/api/audio.zig +++ b/castholm/v0.2.4-3.2.16/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.4-3.2.16/api/blendmode.zig b/castholm/v0.2.4-3.2.16/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.4-3.2.16/api/blendmode.zig +++ b/castholm/v0.2.4-3.2.16/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.4-3.2.16/api/c.zig b/castholm/v0.2.4-3.2.16/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.4-3.2.16/api/camera.zig b/castholm/v0.2.4-3.2.16/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.4-3.2.16/api/camera.zig +++ b/castholm/v0.2.4-3.2.16/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.4-3.2.16/api/clipboard.zig b/castholm/v0.2.4-3.2.16/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.4-3.2.16/api/clipboard.zig +++ b/castholm/v0.2.4-3.2.16/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.4-3.2.16/api/dialog.zig b/castholm/v0.2.4-3.2.16/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.4-3.2.16/api/dialog.zig +++ b/castholm/v0.2.4-3.2.16/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.4-3.2.16/api/error.zig b/castholm/v0.2.4-3.2.16/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.4-3.2.16/api/error.zig +++ b/castholm/v0.2.4-3.2.16/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.4-3.2.16/api/events.zig b/castholm/v0.2.4-3.2.16/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.2.4-3.2.16/api/events.zig +++ b/castholm/v0.2.4-3.2.16/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.4-3.2.16/api/filesystem.zig b/castholm/v0.2.4-3.2.16/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.4-3.2.16/api/filesystem.zig +++ b/castholm/v0.2.4-3.2.16/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.4-3.2.16/api/gamepad.zig b/castholm/v0.2.4-3.2.16/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.4-3.2.16/api/gamepad.zig +++ b/castholm/v0.2.4-3.2.16/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.4-3.2.16/api/gpu.zig b/castholm/v0.2.4-3.2.16/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.4-3.2.16/api/gpu.zig +++ b/castholm/v0.2.4-3.2.16/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.4-3.2.16/api/guid.zig b/castholm/v0.2.4-3.2.16/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.4-3.2.16/api/haptic.zig b/castholm/v0.2.4-3.2.16/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.4-3.2.16/api/haptic.zig +++ b/castholm/v0.2.4-3.2.16/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.4-3.2.16/api/hints.zig b/castholm/v0.2.4-3.2.16/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.4-3.2.16/api/hints.zig +++ b/castholm/v0.2.4-3.2.16/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.4-3.2.16/api/init.zig b/castholm/v0.2.4-3.2.16/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.2.4-3.2.16/api/init.zig +++ b/castholm/v0.2.4-3.2.16/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.4-3.2.16/api/iostream.zig b/castholm/v0.2.4-3.2.16/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.4-3.2.16/api/joystick.zig b/castholm/v0.2.4-3.2.16/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.4-3.2.16/api/joystick.zig +++ b/castholm/v0.2.4-3.2.16/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.4-3.2.16/api/keyboard.zig b/castholm/v0.2.4-3.2.16/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.4-3.2.16/api/keycode.zig b/castholm/v0.2.4-3.2.16/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.4-3.2.16/api/keycode.zig +++ b/castholm/v0.2.4-3.2.16/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.4-3.2.16/api/loadso.zig b/castholm/v0.2.4-3.2.16/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.4-3.2.16/api/loadso.zig +++ b/castholm/v0.2.4-3.2.16/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.4-3.2.16/api/messagebox.zig b/castholm/v0.2.4-3.2.16/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.4-3.2.16/api/messagebox.zig +++ b/castholm/v0.2.4-3.2.16/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.4-3.2.16/api/misc.zig b/castholm/v0.2.4-3.2.16/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.4-3.2.16/api/misc.zig +++ b/castholm/v0.2.4-3.2.16/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.4-3.2.16/api/mouse.zig b/castholm/v0.2.4-3.2.16/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.4-3.2.16/api/mouse.zig +++ b/castholm/v0.2.4-3.2.16/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.4-3.2.16/api/opengl.zig b/castholm/v0.2.4-3.2.16/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.4-3.2.16/api/pen.zig b/castholm/v0.2.4-3.2.16/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.4-3.2.16/api/pixels.zig b/castholm/v0.2.4-3.2.16/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.4-3.2.16/api/pixels.zig +++ b/castholm/v0.2.4-3.2.16/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.4-3.2.16/api/power.zig b/castholm/v0.2.4-3.2.16/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.4-3.2.16/api/process.zig b/castholm/v0.2.4-3.2.16/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.4-3.2.16/api/properties.zig b/castholm/v0.2.4-3.2.16/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.4-3.2.16/api/properties.zig +++ b/castholm/v0.2.4-3.2.16/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.4-3.2.16/api/rect.zig b/castholm/v0.2.4-3.2.16/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.4-3.2.16/api/rect.zig +++ b/castholm/v0.2.4-3.2.16/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.4-3.2.16/api/render.zig b/castholm/v0.2.4-3.2.16/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.2.4-3.2.16/api/render.zig +++ b/castholm/v0.2.4-3.2.16/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.4-3.2.16/api/scancode.zig b/castholm/v0.2.4-3.2.16/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.4-3.2.16/api/sensor.zig b/castholm/v0.2.4-3.2.16/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.4-3.2.16/api/sensor.zig +++ b/castholm/v0.2.4-3.2.16/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.4-3.2.16/api/stdinc.zig b/castholm/v0.2.4-3.2.16/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.4-3.2.16/api/storage.zig b/castholm/v0.2.4-3.2.16/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.4-3.2.16/api/storage.zig +++ b/castholm/v0.2.4-3.2.16/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.4-3.2.16/api/surface.zig b/castholm/v0.2.4-3.2.16/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.4-3.2.16/api/surface.zig +++ b/castholm/v0.2.4-3.2.16/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.4-3.2.16/api/system.zig b/castholm/v0.2.4-3.2.16/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.4-3.2.16/api/system.zig +++ b/castholm/v0.2.4-3.2.16/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.4-3.2.16/api/time.zig b/castholm/v0.2.4-3.2.16/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.4-3.2.16/api/time.zig +++ b/castholm/v0.2.4-3.2.16/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.4-3.2.16/api/timer.zig b/castholm/v0.2.4-3.2.16/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.4-3.2.16/api/timer.zig +++ b/castholm/v0.2.4-3.2.16/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.4-3.2.16/api/touch.zig b/castholm/v0.2.4-3.2.16/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.4-3.2.16/api/touch.zig +++ b/castholm/v0.2.4-3.2.16/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.4-3.2.16/api/tray.zig b/castholm/v0.2.4-3.2.16/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.4-3.2.16/api/version.zig b/castholm/v0.2.4-3.2.16/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.4-3.2.16/api/version.zig +++ b/castholm/v0.2.4-3.2.16/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.4-3.2.16/api/video.zig b/castholm/v0.2.4-3.2.16/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.2.4-3.2.16/api/video.zig +++ b/castholm/v0.2.4-3.2.16/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.4-3.2.16/json/audio.json b/castholm/v0.2.4-3.2.16/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.4-3.2.16/json/audio.json +++ b/castholm/v0.2.4-3.2.16/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.4-3.2.16/json/blendmode.json b/castholm/v0.2.4-3.2.16/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.4-3.2.16/json/blendmode.json +++ b/castholm/v0.2.4-3.2.16/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.4-3.2.16/json/events.json b/castholm/v0.2.4-3.2.16/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.2.4-3.2.16/json/events.json +++ b/castholm/v0.2.4-3.2.16/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.4-3.2.16/json/filesystem.json b/castholm/v0.2.4-3.2.16/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.4-3.2.16/json/filesystem.json +++ b/castholm/v0.2.4-3.2.16/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.4-3.2.16/json/gamepad.json b/castholm/v0.2.4-3.2.16/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.4-3.2.16/json/gamepad.json +++ b/castholm/v0.2.4-3.2.16/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.4-3.2.16/json/gpu.json b/castholm/v0.2.4-3.2.16/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.4-3.2.16/json/gpu.json +++ b/castholm/v0.2.4-3.2.16/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.4-3.2.16/json/guid.json b/castholm/v0.2.4-3.2.16/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/haptic.json b/castholm/v0.2.4-3.2.16/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.4-3.2.16/json/haptic.json +++ b/castholm/v0.2.4-3.2.16/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.4-3.2.16/json/iostream.json b/castholm/v0.2.4-3.2.16/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/joystick.json b/castholm/v0.2.4-3.2.16/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.4-3.2.16/json/joystick.json +++ b/castholm/v0.2.4-3.2.16/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.4-3.2.16/json/keyboard.json b/castholm/v0.2.4-3.2.16/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/opengl.json b/castholm/v0.2.4-3.2.16/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/pen.json b/castholm/v0.2.4-3.2.16/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/pixels.json b/castholm/v0.2.4-3.2.16/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.4-3.2.16/json/pixels.json +++ b/castholm/v0.2.4-3.2.16/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.4-3.2.16/json/power.json b/castholm/v0.2.4-3.2.16/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/process.json b/castholm/v0.2.4-3.2.16/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/scancode.json b/castholm/v0.2.4-3.2.16/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/surface.json b/castholm/v0.2.4-3.2.16/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.4-3.2.16/json/surface.json +++ b/castholm/v0.2.4-3.2.16/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.4-3.2.16/json/system.json b/castholm/v0.2.4-3.2.16/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.4-3.2.16/json/system.json +++ b/castholm/v0.2.4-3.2.16/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.4-3.2.16/json/touch.json b/castholm/v0.2.4-3.2.16/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.4-3.2.16/json/touch.json +++ b/castholm/v0.2.4-3.2.16/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.4-3.2.16/json/tray.json b/castholm/v0.2.4-3.2.16/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.4-3.2.16/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.4-3.2.16/json/video.json b/castholm/v0.2.4-3.2.16/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.2.4-3.2.16/json/video.json +++ b/castholm/v0.2.4-3.2.16/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.5-3.2.18/api/audio.zig b/castholm/v0.2.5-3.2.18/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.5-3.2.18/api/audio.zig +++ b/castholm/v0.2.5-3.2.18/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.5-3.2.18/api/blendmode.zig b/castholm/v0.2.5-3.2.18/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.5-3.2.18/api/blendmode.zig +++ b/castholm/v0.2.5-3.2.18/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.5-3.2.18/api/c.zig b/castholm/v0.2.5-3.2.18/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.5-3.2.18/api/camera.zig b/castholm/v0.2.5-3.2.18/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.5-3.2.18/api/camera.zig +++ b/castholm/v0.2.5-3.2.18/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.5-3.2.18/api/clipboard.zig b/castholm/v0.2.5-3.2.18/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.5-3.2.18/api/clipboard.zig +++ b/castholm/v0.2.5-3.2.18/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.5-3.2.18/api/dialog.zig b/castholm/v0.2.5-3.2.18/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.5-3.2.18/api/dialog.zig +++ b/castholm/v0.2.5-3.2.18/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.5-3.2.18/api/error.zig b/castholm/v0.2.5-3.2.18/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.5-3.2.18/api/error.zig +++ b/castholm/v0.2.5-3.2.18/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.5-3.2.18/api/events.zig b/castholm/v0.2.5-3.2.18/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.2.5-3.2.18/api/events.zig +++ b/castholm/v0.2.5-3.2.18/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.5-3.2.18/api/filesystem.zig b/castholm/v0.2.5-3.2.18/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.5-3.2.18/api/filesystem.zig +++ b/castholm/v0.2.5-3.2.18/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.5-3.2.18/api/gamepad.zig b/castholm/v0.2.5-3.2.18/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.5-3.2.18/api/gamepad.zig +++ b/castholm/v0.2.5-3.2.18/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.5-3.2.18/api/gpu.zig b/castholm/v0.2.5-3.2.18/api/gpu.zig index c5376d7..eed4925 100644 --- a/castholm/v0.2.5-3.2.18/api/gpu.zig +++ b/castholm/v0.2.5-3.2.18/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.5-3.2.18/api/guid.zig b/castholm/v0.2.5-3.2.18/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.5-3.2.18/api/haptic.zig b/castholm/v0.2.5-3.2.18/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.5-3.2.18/api/haptic.zig +++ b/castholm/v0.2.5-3.2.18/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.5-3.2.18/api/hints.zig b/castholm/v0.2.5-3.2.18/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.5-3.2.18/api/hints.zig +++ b/castholm/v0.2.5-3.2.18/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.5-3.2.18/api/init.zig b/castholm/v0.2.5-3.2.18/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.2.5-3.2.18/api/init.zig +++ b/castholm/v0.2.5-3.2.18/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.5-3.2.18/api/iostream.zig b/castholm/v0.2.5-3.2.18/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.5-3.2.18/api/joystick.zig b/castholm/v0.2.5-3.2.18/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.5-3.2.18/api/joystick.zig +++ b/castholm/v0.2.5-3.2.18/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.5-3.2.18/api/keyboard.zig b/castholm/v0.2.5-3.2.18/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.5-3.2.18/api/keycode.zig b/castholm/v0.2.5-3.2.18/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.5-3.2.18/api/keycode.zig +++ b/castholm/v0.2.5-3.2.18/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.5-3.2.18/api/loadso.zig b/castholm/v0.2.5-3.2.18/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.5-3.2.18/api/loadso.zig +++ b/castholm/v0.2.5-3.2.18/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.5-3.2.18/api/messagebox.zig b/castholm/v0.2.5-3.2.18/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.5-3.2.18/api/messagebox.zig +++ b/castholm/v0.2.5-3.2.18/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.5-3.2.18/api/misc.zig b/castholm/v0.2.5-3.2.18/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.5-3.2.18/api/misc.zig +++ b/castholm/v0.2.5-3.2.18/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.5-3.2.18/api/mouse.zig b/castholm/v0.2.5-3.2.18/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.5-3.2.18/api/mouse.zig +++ b/castholm/v0.2.5-3.2.18/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.5-3.2.18/api/opengl.zig b/castholm/v0.2.5-3.2.18/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.5-3.2.18/api/pen.zig b/castholm/v0.2.5-3.2.18/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.5-3.2.18/api/pixels.zig b/castholm/v0.2.5-3.2.18/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.5-3.2.18/api/pixels.zig +++ b/castholm/v0.2.5-3.2.18/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.5-3.2.18/api/power.zig b/castholm/v0.2.5-3.2.18/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.5-3.2.18/api/process.zig b/castholm/v0.2.5-3.2.18/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.5-3.2.18/api/properties.zig b/castholm/v0.2.5-3.2.18/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.5-3.2.18/api/properties.zig +++ b/castholm/v0.2.5-3.2.18/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.5-3.2.18/api/rect.zig b/castholm/v0.2.5-3.2.18/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.5-3.2.18/api/rect.zig +++ b/castholm/v0.2.5-3.2.18/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.5-3.2.18/api/render.zig b/castholm/v0.2.5-3.2.18/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.2.5-3.2.18/api/render.zig +++ b/castholm/v0.2.5-3.2.18/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.5-3.2.18/api/scancode.zig b/castholm/v0.2.5-3.2.18/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.5-3.2.18/api/sensor.zig b/castholm/v0.2.5-3.2.18/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.5-3.2.18/api/sensor.zig +++ b/castholm/v0.2.5-3.2.18/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.5-3.2.18/api/stdinc.zig b/castholm/v0.2.5-3.2.18/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.5-3.2.18/api/storage.zig b/castholm/v0.2.5-3.2.18/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.5-3.2.18/api/storage.zig +++ b/castholm/v0.2.5-3.2.18/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.5-3.2.18/api/surface.zig b/castholm/v0.2.5-3.2.18/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.5-3.2.18/api/surface.zig +++ b/castholm/v0.2.5-3.2.18/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.5-3.2.18/api/system.zig b/castholm/v0.2.5-3.2.18/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.5-3.2.18/api/system.zig +++ b/castholm/v0.2.5-3.2.18/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.5-3.2.18/api/time.zig b/castholm/v0.2.5-3.2.18/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.5-3.2.18/api/time.zig +++ b/castholm/v0.2.5-3.2.18/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.5-3.2.18/api/timer.zig b/castholm/v0.2.5-3.2.18/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.5-3.2.18/api/timer.zig +++ b/castholm/v0.2.5-3.2.18/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.5-3.2.18/api/touch.zig b/castholm/v0.2.5-3.2.18/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.5-3.2.18/api/touch.zig +++ b/castholm/v0.2.5-3.2.18/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.5-3.2.18/api/tray.zig b/castholm/v0.2.5-3.2.18/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.5-3.2.18/api/version.zig b/castholm/v0.2.5-3.2.18/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.5-3.2.18/api/version.zig +++ b/castholm/v0.2.5-3.2.18/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.5-3.2.18/api/video.zig b/castholm/v0.2.5-3.2.18/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.2.5-3.2.18/api/video.zig +++ b/castholm/v0.2.5-3.2.18/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.5-3.2.18/json/audio.json b/castholm/v0.2.5-3.2.18/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.5-3.2.18/json/audio.json +++ b/castholm/v0.2.5-3.2.18/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.5-3.2.18/json/blendmode.json b/castholm/v0.2.5-3.2.18/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.5-3.2.18/json/blendmode.json +++ b/castholm/v0.2.5-3.2.18/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.5-3.2.18/json/events.json b/castholm/v0.2.5-3.2.18/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.2.5-3.2.18/json/events.json +++ b/castholm/v0.2.5-3.2.18/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.5-3.2.18/json/filesystem.json b/castholm/v0.2.5-3.2.18/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.5-3.2.18/json/filesystem.json +++ b/castholm/v0.2.5-3.2.18/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.5-3.2.18/json/gamepad.json b/castholm/v0.2.5-3.2.18/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.5-3.2.18/json/gamepad.json +++ b/castholm/v0.2.5-3.2.18/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.5-3.2.18/json/gpu.json b/castholm/v0.2.5-3.2.18/json/gpu.json index 95664ef..170f1aa 100644 --- a/castholm/v0.2.5-3.2.18/json/gpu.json +++ b/castholm/v0.2.5-3.2.18/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.5-3.2.18/json/guid.json b/castholm/v0.2.5-3.2.18/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/haptic.json b/castholm/v0.2.5-3.2.18/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.5-3.2.18/json/haptic.json +++ b/castholm/v0.2.5-3.2.18/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.5-3.2.18/json/iostream.json b/castholm/v0.2.5-3.2.18/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/joystick.json b/castholm/v0.2.5-3.2.18/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.5-3.2.18/json/joystick.json +++ b/castholm/v0.2.5-3.2.18/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.5-3.2.18/json/keyboard.json b/castholm/v0.2.5-3.2.18/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/opengl.json b/castholm/v0.2.5-3.2.18/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/pen.json b/castholm/v0.2.5-3.2.18/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/pixels.json b/castholm/v0.2.5-3.2.18/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.5-3.2.18/json/pixels.json +++ b/castholm/v0.2.5-3.2.18/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.5-3.2.18/json/power.json b/castholm/v0.2.5-3.2.18/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/process.json b/castholm/v0.2.5-3.2.18/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/scancode.json b/castholm/v0.2.5-3.2.18/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/surface.json b/castholm/v0.2.5-3.2.18/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.5-3.2.18/json/surface.json +++ b/castholm/v0.2.5-3.2.18/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.5-3.2.18/json/system.json b/castholm/v0.2.5-3.2.18/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.5-3.2.18/json/system.json +++ b/castholm/v0.2.5-3.2.18/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.5-3.2.18/json/touch.json b/castholm/v0.2.5-3.2.18/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.5-3.2.18/json/touch.json +++ b/castholm/v0.2.5-3.2.18/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.5-3.2.18/json/tray.json b/castholm/v0.2.5-3.2.18/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.5-3.2.18/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.5-3.2.18/json/video.json b/castholm/v0.2.5-3.2.18/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.2.5-3.2.18/json/video.json +++ b/castholm/v0.2.5-3.2.18/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.2.6-3.2.20/api/audio.zig b/castholm/v0.2.6-3.2.20/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.2.6-3.2.20/api/audio.zig +++ b/castholm/v0.2.6-3.2.20/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.2.6-3.2.20/api/blendmode.zig b/castholm/v0.2.6-3.2.20/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.2.6-3.2.20/api/blendmode.zig +++ b/castholm/v0.2.6-3.2.20/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.2.6-3.2.20/api/c.zig b/castholm/v0.2.6-3.2.20/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.2.6-3.2.20/api/camera.zig b/castholm/v0.2.6-3.2.20/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/castholm/v0.2.6-3.2.20/api/camera.zig +++ b/castholm/v0.2.6-3.2.20/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.2.6-3.2.20/api/clipboard.zig b/castholm/v0.2.6-3.2.20/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.2.6-3.2.20/api/clipboard.zig +++ b/castholm/v0.2.6-3.2.20/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.2.6-3.2.20/api/dialog.zig b/castholm/v0.2.6-3.2.20/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.2.6-3.2.20/api/dialog.zig +++ b/castholm/v0.2.6-3.2.20/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.2.6-3.2.20/api/error.zig b/castholm/v0.2.6-3.2.20/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.2.6-3.2.20/api/error.zig +++ b/castholm/v0.2.6-3.2.20/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.2.6-3.2.20/api/events.zig b/castholm/v0.2.6-3.2.20/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.2.6-3.2.20/api/events.zig +++ b/castholm/v0.2.6-3.2.20/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.2.6-3.2.20/api/filesystem.zig b/castholm/v0.2.6-3.2.20/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.2.6-3.2.20/api/filesystem.zig +++ b/castholm/v0.2.6-3.2.20/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.2.6-3.2.20/api/gamepad.zig b/castholm/v0.2.6-3.2.20/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/castholm/v0.2.6-3.2.20/api/gamepad.zig +++ b/castholm/v0.2.6-3.2.20/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.2.6-3.2.20/api/gpu.zig b/castholm/v0.2.6-3.2.20/api/gpu.zig index 4f893ef..5aa5a62 100644 --- a/castholm/v0.2.6-3.2.20/api/gpu.zig +++ b/castholm/v0.2.6-3.2.20/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.2.6-3.2.20/api/guid.zig b/castholm/v0.2.6-3.2.20/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.2.6-3.2.20/api/haptic.zig b/castholm/v0.2.6-3.2.20/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.2.6-3.2.20/api/haptic.zig +++ b/castholm/v0.2.6-3.2.20/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.2.6-3.2.20/api/hints.zig b/castholm/v0.2.6-3.2.20/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.2.6-3.2.20/api/hints.zig +++ b/castholm/v0.2.6-3.2.20/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.2.6-3.2.20/api/init.zig b/castholm/v0.2.6-3.2.20/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.2.6-3.2.20/api/init.zig +++ b/castholm/v0.2.6-3.2.20/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.2.6-3.2.20/api/iostream.zig b/castholm/v0.2.6-3.2.20/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.2.6-3.2.20/api/joystick.zig b/castholm/v0.2.6-3.2.20/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/castholm/v0.2.6-3.2.20/api/joystick.zig +++ b/castholm/v0.2.6-3.2.20/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.2.6-3.2.20/api/keyboard.zig b/castholm/v0.2.6-3.2.20/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.2.6-3.2.20/api/keycode.zig b/castholm/v0.2.6-3.2.20/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.2.6-3.2.20/api/keycode.zig +++ b/castholm/v0.2.6-3.2.20/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.2.6-3.2.20/api/loadso.zig b/castholm/v0.2.6-3.2.20/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.2.6-3.2.20/api/loadso.zig +++ b/castholm/v0.2.6-3.2.20/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.2.6-3.2.20/api/messagebox.zig b/castholm/v0.2.6-3.2.20/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.2.6-3.2.20/api/messagebox.zig +++ b/castholm/v0.2.6-3.2.20/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.2.6-3.2.20/api/misc.zig b/castholm/v0.2.6-3.2.20/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.2.6-3.2.20/api/misc.zig +++ b/castholm/v0.2.6-3.2.20/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.2.6-3.2.20/api/mouse.zig b/castholm/v0.2.6-3.2.20/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.2.6-3.2.20/api/mouse.zig +++ b/castholm/v0.2.6-3.2.20/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.2.6-3.2.20/api/opengl.zig b/castholm/v0.2.6-3.2.20/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.2.6-3.2.20/api/pen.zig b/castholm/v0.2.6-3.2.20/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.2.6-3.2.20/api/pixels.zig b/castholm/v0.2.6-3.2.20/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.2.6-3.2.20/api/pixels.zig +++ b/castholm/v0.2.6-3.2.20/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.2.6-3.2.20/api/power.zig b/castholm/v0.2.6-3.2.20/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.2.6-3.2.20/api/process.zig b/castholm/v0.2.6-3.2.20/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.2.6-3.2.20/api/properties.zig b/castholm/v0.2.6-3.2.20/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.2.6-3.2.20/api/properties.zig +++ b/castholm/v0.2.6-3.2.20/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.2.6-3.2.20/api/rect.zig b/castholm/v0.2.6-3.2.20/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.2.6-3.2.20/api/rect.zig +++ b/castholm/v0.2.6-3.2.20/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.2.6-3.2.20/api/render.zig b/castholm/v0.2.6-3.2.20/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.2.6-3.2.20/api/render.zig +++ b/castholm/v0.2.6-3.2.20/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.2.6-3.2.20/api/scancode.zig b/castholm/v0.2.6-3.2.20/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.2.6-3.2.20/api/sensor.zig b/castholm/v0.2.6-3.2.20/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/castholm/v0.2.6-3.2.20/api/sensor.zig +++ b/castholm/v0.2.6-3.2.20/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.2.6-3.2.20/api/stdinc.zig b/castholm/v0.2.6-3.2.20/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.2.6-3.2.20/api/storage.zig b/castholm/v0.2.6-3.2.20/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.2.6-3.2.20/api/storage.zig +++ b/castholm/v0.2.6-3.2.20/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.2.6-3.2.20/api/surface.zig b/castholm/v0.2.6-3.2.20/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.2.6-3.2.20/api/surface.zig +++ b/castholm/v0.2.6-3.2.20/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.2.6-3.2.20/api/system.zig b/castholm/v0.2.6-3.2.20/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.2.6-3.2.20/api/system.zig +++ b/castholm/v0.2.6-3.2.20/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.2.6-3.2.20/api/time.zig b/castholm/v0.2.6-3.2.20/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.2.6-3.2.20/api/time.zig +++ b/castholm/v0.2.6-3.2.20/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.2.6-3.2.20/api/timer.zig b/castholm/v0.2.6-3.2.20/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.2.6-3.2.20/api/timer.zig +++ b/castholm/v0.2.6-3.2.20/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.2.6-3.2.20/api/touch.zig b/castholm/v0.2.6-3.2.20/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.2.6-3.2.20/api/touch.zig +++ b/castholm/v0.2.6-3.2.20/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.2.6-3.2.20/api/tray.zig b/castholm/v0.2.6-3.2.20/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.2.6-3.2.20/api/version.zig b/castholm/v0.2.6-3.2.20/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.2.6-3.2.20/api/version.zig +++ b/castholm/v0.2.6-3.2.20/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.2.6-3.2.20/api/video.zig b/castholm/v0.2.6-3.2.20/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.2.6-3.2.20/api/video.zig +++ b/castholm/v0.2.6-3.2.20/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.2.6-3.2.20/json/audio.json b/castholm/v0.2.6-3.2.20/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.2.6-3.2.20/json/audio.json +++ b/castholm/v0.2.6-3.2.20/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.2.6-3.2.20/json/blendmode.json b/castholm/v0.2.6-3.2.20/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.2.6-3.2.20/json/blendmode.json +++ b/castholm/v0.2.6-3.2.20/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.2.6-3.2.20/json/events.json b/castholm/v0.2.6-3.2.20/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.2.6-3.2.20/json/events.json +++ b/castholm/v0.2.6-3.2.20/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.2.6-3.2.20/json/filesystem.json b/castholm/v0.2.6-3.2.20/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.2.6-3.2.20/json/filesystem.json +++ b/castholm/v0.2.6-3.2.20/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.2.6-3.2.20/json/gamepad.json b/castholm/v0.2.6-3.2.20/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.2.6-3.2.20/json/gamepad.json +++ b/castholm/v0.2.6-3.2.20/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.2.6-3.2.20/json/gpu.json b/castholm/v0.2.6-3.2.20/json/gpu.json index 3202a8d..3508694 100644 --- a/castholm/v0.2.6-3.2.20/json/gpu.json +++ b/castholm/v0.2.6-3.2.20/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.2.6-3.2.20/json/guid.json b/castholm/v0.2.6-3.2.20/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/haptic.json b/castholm/v0.2.6-3.2.20/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.2.6-3.2.20/json/haptic.json +++ b/castholm/v0.2.6-3.2.20/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.2.6-3.2.20/json/iostream.json b/castholm/v0.2.6-3.2.20/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/joystick.json b/castholm/v0.2.6-3.2.20/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.2.6-3.2.20/json/joystick.json +++ b/castholm/v0.2.6-3.2.20/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.2.6-3.2.20/json/keyboard.json b/castholm/v0.2.6-3.2.20/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/opengl.json b/castholm/v0.2.6-3.2.20/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/pen.json b/castholm/v0.2.6-3.2.20/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/pixels.json b/castholm/v0.2.6-3.2.20/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.2.6-3.2.20/json/pixels.json +++ b/castholm/v0.2.6-3.2.20/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.2.6-3.2.20/json/power.json b/castholm/v0.2.6-3.2.20/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/process.json b/castholm/v0.2.6-3.2.20/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/scancode.json b/castholm/v0.2.6-3.2.20/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/surface.json b/castholm/v0.2.6-3.2.20/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.2.6-3.2.20/json/surface.json +++ b/castholm/v0.2.6-3.2.20/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.2.6-3.2.20/json/system.json b/castholm/v0.2.6-3.2.20/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.2.6-3.2.20/json/system.json +++ b/castholm/v0.2.6-3.2.20/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.2.6-3.2.20/json/touch.json b/castholm/v0.2.6-3.2.20/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.2.6-3.2.20/json/touch.json +++ b/castholm/v0.2.6-3.2.20/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.2.6-3.2.20/json/tray.json b/castholm/v0.2.6-3.2.20/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.2.6-3.2.20/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.2.6-3.2.20/json/video.json b/castholm/v0.2.6-3.2.20/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.2.6-3.2.20/json/video.json +++ b/castholm/v0.2.6-3.2.20/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.3.0-3.2.22/api/audio.zig b/castholm/v0.3.0-3.2.22/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.3.0-3.2.22/api/audio.zig +++ b/castholm/v0.3.0-3.2.22/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.3.0-3.2.22/api/blendmode.zig b/castholm/v0.3.0-3.2.22/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.3.0-3.2.22/api/blendmode.zig +++ b/castholm/v0.3.0-3.2.22/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.3.0-3.2.22/api/c.zig b/castholm/v0.3.0-3.2.22/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.3.0-3.2.22/api/camera.zig b/castholm/v0.3.0-3.2.22/api/camera.zig index 80c77b8..4a2c467 100644 --- a/castholm/v0.3.0-3.2.22/api/camera.zig +++ b/castholm/v0.3.0-3.2.22/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.3.0-3.2.22/api/clipboard.zig b/castholm/v0.3.0-3.2.22/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.3.0-3.2.22/api/clipboard.zig +++ b/castholm/v0.3.0-3.2.22/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.3.0-3.2.22/api/dialog.zig b/castholm/v0.3.0-3.2.22/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.3.0-3.2.22/api/dialog.zig +++ b/castholm/v0.3.0-3.2.22/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.3.0-3.2.22/api/error.zig b/castholm/v0.3.0-3.2.22/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.3.0-3.2.22/api/error.zig +++ b/castholm/v0.3.0-3.2.22/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.3.0-3.2.22/api/events.zig b/castholm/v0.3.0-3.2.22/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.3.0-3.2.22/api/events.zig +++ b/castholm/v0.3.0-3.2.22/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.3.0-3.2.22/api/filesystem.zig b/castholm/v0.3.0-3.2.22/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.3.0-3.2.22/api/filesystem.zig +++ b/castholm/v0.3.0-3.2.22/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.3.0-3.2.22/api/gamepad.zig b/castholm/v0.3.0-3.2.22/api/gamepad.zig index 413c625..1f8f790 100644 --- a/castholm/v0.3.0-3.2.22/api/gamepad.zig +++ b/castholm/v0.3.0-3.2.22/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.3.0-3.2.22/api/gpu.zig b/castholm/v0.3.0-3.2.22/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/castholm/v0.3.0-3.2.22/api/gpu.zig +++ b/castholm/v0.3.0-3.2.22/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.3.0-3.2.22/api/guid.zig b/castholm/v0.3.0-3.2.22/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.3.0-3.2.22/api/haptic.zig b/castholm/v0.3.0-3.2.22/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.3.0-3.2.22/api/haptic.zig +++ b/castholm/v0.3.0-3.2.22/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.3.0-3.2.22/api/hints.zig b/castholm/v0.3.0-3.2.22/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.3.0-3.2.22/api/hints.zig +++ b/castholm/v0.3.0-3.2.22/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.3.0-3.2.22/api/init.zig b/castholm/v0.3.0-3.2.22/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.3.0-3.2.22/api/init.zig +++ b/castholm/v0.3.0-3.2.22/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.3.0-3.2.22/api/iostream.zig b/castholm/v0.3.0-3.2.22/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.3.0-3.2.22/api/joystick.zig b/castholm/v0.3.0-3.2.22/api/joystick.zig index 3f57466..a6cee42 100644 --- a/castholm/v0.3.0-3.2.22/api/joystick.zig +++ b/castholm/v0.3.0-3.2.22/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.3.0-3.2.22/api/keyboard.zig b/castholm/v0.3.0-3.2.22/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.3.0-3.2.22/api/keycode.zig b/castholm/v0.3.0-3.2.22/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.3.0-3.2.22/api/keycode.zig +++ b/castholm/v0.3.0-3.2.22/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.3.0-3.2.22/api/loadso.zig b/castholm/v0.3.0-3.2.22/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.3.0-3.2.22/api/loadso.zig +++ b/castholm/v0.3.0-3.2.22/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.3.0-3.2.22/api/messagebox.zig b/castholm/v0.3.0-3.2.22/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.3.0-3.2.22/api/messagebox.zig +++ b/castholm/v0.3.0-3.2.22/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.3.0-3.2.22/api/misc.zig b/castholm/v0.3.0-3.2.22/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.3.0-3.2.22/api/misc.zig +++ b/castholm/v0.3.0-3.2.22/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.3.0-3.2.22/api/mouse.zig b/castholm/v0.3.0-3.2.22/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.3.0-3.2.22/api/mouse.zig +++ b/castholm/v0.3.0-3.2.22/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.3.0-3.2.22/api/opengl.zig b/castholm/v0.3.0-3.2.22/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.3.0-3.2.22/api/pen.zig b/castholm/v0.3.0-3.2.22/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.3.0-3.2.22/api/pixels.zig b/castholm/v0.3.0-3.2.22/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.3.0-3.2.22/api/pixels.zig +++ b/castholm/v0.3.0-3.2.22/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.3.0-3.2.22/api/power.zig b/castholm/v0.3.0-3.2.22/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.3.0-3.2.22/api/process.zig b/castholm/v0.3.0-3.2.22/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.3.0-3.2.22/api/properties.zig b/castholm/v0.3.0-3.2.22/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.3.0-3.2.22/api/properties.zig +++ b/castholm/v0.3.0-3.2.22/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.3.0-3.2.22/api/rect.zig b/castholm/v0.3.0-3.2.22/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.3.0-3.2.22/api/rect.zig +++ b/castholm/v0.3.0-3.2.22/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.3.0-3.2.22/api/render.zig b/castholm/v0.3.0-3.2.22/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.3.0-3.2.22/api/render.zig +++ b/castholm/v0.3.0-3.2.22/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.3.0-3.2.22/api/scancode.zig b/castholm/v0.3.0-3.2.22/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.3.0-3.2.22/api/sensor.zig b/castholm/v0.3.0-3.2.22/api/sensor.zig index cc7fe67..f471675 100644 --- a/castholm/v0.3.0-3.2.22/api/sensor.zig +++ b/castholm/v0.3.0-3.2.22/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.3.0-3.2.22/api/stdinc.zig b/castholm/v0.3.0-3.2.22/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.3.0-3.2.22/api/storage.zig b/castholm/v0.3.0-3.2.22/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.3.0-3.2.22/api/storage.zig +++ b/castholm/v0.3.0-3.2.22/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.3.0-3.2.22/api/surface.zig b/castholm/v0.3.0-3.2.22/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.3.0-3.2.22/api/surface.zig +++ b/castholm/v0.3.0-3.2.22/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.3.0-3.2.22/api/system.zig b/castholm/v0.3.0-3.2.22/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.3.0-3.2.22/api/system.zig +++ b/castholm/v0.3.0-3.2.22/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.3.0-3.2.22/api/time.zig b/castholm/v0.3.0-3.2.22/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.3.0-3.2.22/api/time.zig +++ b/castholm/v0.3.0-3.2.22/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.3.0-3.2.22/api/timer.zig b/castholm/v0.3.0-3.2.22/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.3.0-3.2.22/api/timer.zig +++ b/castholm/v0.3.0-3.2.22/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.3.0-3.2.22/api/touch.zig b/castholm/v0.3.0-3.2.22/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.3.0-3.2.22/api/touch.zig +++ b/castholm/v0.3.0-3.2.22/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.3.0-3.2.22/api/tray.zig b/castholm/v0.3.0-3.2.22/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.3.0-3.2.22/api/version.zig b/castholm/v0.3.0-3.2.22/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.3.0-3.2.22/api/version.zig +++ b/castholm/v0.3.0-3.2.22/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.3.0-3.2.22/api/video.zig b/castholm/v0.3.0-3.2.22/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.3.0-3.2.22/api/video.zig +++ b/castholm/v0.3.0-3.2.22/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.3.0-3.2.22/json/audio.json b/castholm/v0.3.0-3.2.22/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.3.0-3.2.22/json/audio.json +++ b/castholm/v0.3.0-3.2.22/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.3.0-3.2.22/json/blendmode.json b/castholm/v0.3.0-3.2.22/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.3.0-3.2.22/json/blendmode.json +++ b/castholm/v0.3.0-3.2.22/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.3.0-3.2.22/json/events.json b/castholm/v0.3.0-3.2.22/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.3.0-3.2.22/json/events.json +++ b/castholm/v0.3.0-3.2.22/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.3.0-3.2.22/json/filesystem.json b/castholm/v0.3.0-3.2.22/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.3.0-3.2.22/json/filesystem.json +++ b/castholm/v0.3.0-3.2.22/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.3.0-3.2.22/json/gamepad.json b/castholm/v0.3.0-3.2.22/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.3.0-3.2.22/json/gamepad.json +++ b/castholm/v0.3.0-3.2.22/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.3.0-3.2.22/json/gpu.json b/castholm/v0.3.0-3.2.22/json/gpu.json index 2bc908a..e981357 100644 --- a/castholm/v0.3.0-3.2.22/json/gpu.json +++ b/castholm/v0.3.0-3.2.22/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.3.0-3.2.22/json/guid.json b/castholm/v0.3.0-3.2.22/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/haptic.json b/castholm/v0.3.0-3.2.22/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.3.0-3.2.22/json/haptic.json +++ b/castholm/v0.3.0-3.2.22/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.3.0-3.2.22/json/iostream.json b/castholm/v0.3.0-3.2.22/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/joystick.json b/castholm/v0.3.0-3.2.22/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.3.0-3.2.22/json/joystick.json +++ b/castholm/v0.3.0-3.2.22/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.3.0-3.2.22/json/keyboard.json b/castholm/v0.3.0-3.2.22/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/opengl.json b/castholm/v0.3.0-3.2.22/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/pen.json b/castholm/v0.3.0-3.2.22/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/pixels.json b/castholm/v0.3.0-3.2.22/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.3.0-3.2.22/json/pixels.json +++ b/castholm/v0.3.0-3.2.22/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.3.0-3.2.22/json/power.json b/castholm/v0.3.0-3.2.22/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/process.json b/castholm/v0.3.0-3.2.22/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/scancode.json b/castholm/v0.3.0-3.2.22/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/surface.json b/castholm/v0.3.0-3.2.22/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.3.0-3.2.22/json/surface.json +++ b/castholm/v0.3.0-3.2.22/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.3.0-3.2.22/json/system.json b/castholm/v0.3.0-3.2.22/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.3.0-3.2.22/json/system.json +++ b/castholm/v0.3.0-3.2.22/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.3.0-3.2.22/json/touch.json b/castholm/v0.3.0-3.2.22/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.3.0-3.2.22/json/touch.json +++ b/castholm/v0.3.0-3.2.22/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.3.0-3.2.22/json/tray.json b/castholm/v0.3.0-3.2.22/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.3.0-3.2.22/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.0-3.2.22/json/video.json b/castholm/v0.3.0-3.2.22/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.3.0-3.2.22/json/video.json +++ b/castholm/v0.3.0-3.2.22/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.3.1-3.2.24/api/audio.zig b/castholm/v0.3.1-3.2.24/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.3.1-3.2.24/api/audio.zig +++ b/castholm/v0.3.1-3.2.24/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.3.1-3.2.24/api/blendmode.zig b/castholm/v0.3.1-3.2.24/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.3.1-3.2.24/api/blendmode.zig +++ b/castholm/v0.3.1-3.2.24/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.3.1-3.2.24/api/c.zig b/castholm/v0.3.1-3.2.24/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.3.1-3.2.24/api/camera.zig b/castholm/v0.3.1-3.2.24/api/camera.zig index 80c77b8..4a2c467 100644 --- a/castholm/v0.3.1-3.2.24/api/camera.zig +++ b/castholm/v0.3.1-3.2.24/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.3.1-3.2.24/api/clipboard.zig b/castholm/v0.3.1-3.2.24/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.3.1-3.2.24/api/clipboard.zig +++ b/castholm/v0.3.1-3.2.24/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.3.1-3.2.24/api/dialog.zig b/castholm/v0.3.1-3.2.24/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.3.1-3.2.24/api/dialog.zig +++ b/castholm/v0.3.1-3.2.24/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.3.1-3.2.24/api/error.zig b/castholm/v0.3.1-3.2.24/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.3.1-3.2.24/api/error.zig +++ b/castholm/v0.3.1-3.2.24/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.3.1-3.2.24/api/events.zig b/castholm/v0.3.1-3.2.24/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.3.1-3.2.24/api/events.zig +++ b/castholm/v0.3.1-3.2.24/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.3.1-3.2.24/api/filesystem.zig b/castholm/v0.3.1-3.2.24/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.3.1-3.2.24/api/filesystem.zig +++ b/castholm/v0.3.1-3.2.24/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.3.1-3.2.24/api/gamepad.zig b/castholm/v0.3.1-3.2.24/api/gamepad.zig index 413c625..1f8f790 100644 --- a/castholm/v0.3.1-3.2.24/api/gamepad.zig +++ b/castholm/v0.3.1-3.2.24/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.3.1-3.2.24/api/gpu.zig b/castholm/v0.3.1-3.2.24/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/castholm/v0.3.1-3.2.24/api/gpu.zig +++ b/castholm/v0.3.1-3.2.24/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.3.1-3.2.24/api/guid.zig b/castholm/v0.3.1-3.2.24/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.3.1-3.2.24/api/haptic.zig b/castholm/v0.3.1-3.2.24/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.3.1-3.2.24/api/haptic.zig +++ b/castholm/v0.3.1-3.2.24/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.3.1-3.2.24/api/hints.zig b/castholm/v0.3.1-3.2.24/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.3.1-3.2.24/api/hints.zig +++ b/castholm/v0.3.1-3.2.24/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.3.1-3.2.24/api/init.zig b/castholm/v0.3.1-3.2.24/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.3.1-3.2.24/api/init.zig +++ b/castholm/v0.3.1-3.2.24/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.3.1-3.2.24/api/iostream.zig b/castholm/v0.3.1-3.2.24/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.3.1-3.2.24/api/joystick.zig b/castholm/v0.3.1-3.2.24/api/joystick.zig index 3f57466..a6cee42 100644 --- a/castholm/v0.3.1-3.2.24/api/joystick.zig +++ b/castholm/v0.3.1-3.2.24/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.3.1-3.2.24/api/keyboard.zig b/castholm/v0.3.1-3.2.24/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.3.1-3.2.24/api/keycode.zig b/castholm/v0.3.1-3.2.24/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.3.1-3.2.24/api/keycode.zig +++ b/castholm/v0.3.1-3.2.24/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.3.1-3.2.24/api/loadso.zig b/castholm/v0.3.1-3.2.24/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.3.1-3.2.24/api/loadso.zig +++ b/castholm/v0.3.1-3.2.24/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.3.1-3.2.24/api/messagebox.zig b/castholm/v0.3.1-3.2.24/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.3.1-3.2.24/api/messagebox.zig +++ b/castholm/v0.3.1-3.2.24/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.3.1-3.2.24/api/misc.zig b/castholm/v0.3.1-3.2.24/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.3.1-3.2.24/api/misc.zig +++ b/castholm/v0.3.1-3.2.24/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.3.1-3.2.24/api/mouse.zig b/castholm/v0.3.1-3.2.24/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.3.1-3.2.24/api/mouse.zig +++ b/castholm/v0.3.1-3.2.24/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.3.1-3.2.24/api/opengl.zig b/castholm/v0.3.1-3.2.24/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.3.1-3.2.24/api/pen.zig b/castholm/v0.3.1-3.2.24/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.3.1-3.2.24/api/pixels.zig b/castholm/v0.3.1-3.2.24/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.3.1-3.2.24/api/pixels.zig +++ b/castholm/v0.3.1-3.2.24/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.3.1-3.2.24/api/power.zig b/castholm/v0.3.1-3.2.24/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.3.1-3.2.24/api/process.zig b/castholm/v0.3.1-3.2.24/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.3.1-3.2.24/api/properties.zig b/castholm/v0.3.1-3.2.24/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.3.1-3.2.24/api/properties.zig +++ b/castholm/v0.3.1-3.2.24/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.3.1-3.2.24/api/rect.zig b/castholm/v0.3.1-3.2.24/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.3.1-3.2.24/api/rect.zig +++ b/castholm/v0.3.1-3.2.24/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.3.1-3.2.24/api/render.zig b/castholm/v0.3.1-3.2.24/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.3.1-3.2.24/api/render.zig +++ b/castholm/v0.3.1-3.2.24/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.3.1-3.2.24/api/scancode.zig b/castholm/v0.3.1-3.2.24/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.3.1-3.2.24/api/sensor.zig b/castholm/v0.3.1-3.2.24/api/sensor.zig index cc7fe67..f471675 100644 --- a/castholm/v0.3.1-3.2.24/api/sensor.zig +++ b/castholm/v0.3.1-3.2.24/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.3.1-3.2.24/api/stdinc.zig b/castholm/v0.3.1-3.2.24/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.3.1-3.2.24/api/storage.zig b/castholm/v0.3.1-3.2.24/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.3.1-3.2.24/api/storage.zig +++ b/castholm/v0.3.1-3.2.24/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.3.1-3.2.24/api/surface.zig b/castholm/v0.3.1-3.2.24/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.3.1-3.2.24/api/surface.zig +++ b/castholm/v0.3.1-3.2.24/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.3.1-3.2.24/api/system.zig b/castholm/v0.3.1-3.2.24/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.3.1-3.2.24/api/system.zig +++ b/castholm/v0.3.1-3.2.24/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.3.1-3.2.24/api/time.zig b/castholm/v0.3.1-3.2.24/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.3.1-3.2.24/api/time.zig +++ b/castholm/v0.3.1-3.2.24/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.3.1-3.2.24/api/timer.zig b/castholm/v0.3.1-3.2.24/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.3.1-3.2.24/api/timer.zig +++ b/castholm/v0.3.1-3.2.24/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.3.1-3.2.24/api/touch.zig b/castholm/v0.3.1-3.2.24/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.3.1-3.2.24/api/touch.zig +++ b/castholm/v0.3.1-3.2.24/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.3.1-3.2.24/api/tray.zig b/castholm/v0.3.1-3.2.24/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.3.1-3.2.24/api/version.zig b/castholm/v0.3.1-3.2.24/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.3.1-3.2.24/api/version.zig +++ b/castholm/v0.3.1-3.2.24/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.3.1-3.2.24/api/video.zig b/castholm/v0.3.1-3.2.24/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.3.1-3.2.24/api/video.zig +++ b/castholm/v0.3.1-3.2.24/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.3.1-3.2.24/json/audio.json b/castholm/v0.3.1-3.2.24/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.3.1-3.2.24/json/audio.json +++ b/castholm/v0.3.1-3.2.24/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.3.1-3.2.24/json/blendmode.json b/castholm/v0.3.1-3.2.24/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.3.1-3.2.24/json/blendmode.json +++ b/castholm/v0.3.1-3.2.24/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.3.1-3.2.24/json/events.json b/castholm/v0.3.1-3.2.24/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.3.1-3.2.24/json/events.json +++ b/castholm/v0.3.1-3.2.24/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.3.1-3.2.24/json/filesystem.json b/castholm/v0.3.1-3.2.24/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.3.1-3.2.24/json/filesystem.json +++ b/castholm/v0.3.1-3.2.24/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.3.1-3.2.24/json/gamepad.json b/castholm/v0.3.1-3.2.24/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.3.1-3.2.24/json/gamepad.json +++ b/castholm/v0.3.1-3.2.24/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.3.1-3.2.24/json/gpu.json b/castholm/v0.3.1-3.2.24/json/gpu.json index 2bc908a..e981357 100644 --- a/castholm/v0.3.1-3.2.24/json/gpu.json +++ b/castholm/v0.3.1-3.2.24/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.3.1-3.2.24/json/guid.json b/castholm/v0.3.1-3.2.24/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/haptic.json b/castholm/v0.3.1-3.2.24/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.3.1-3.2.24/json/haptic.json +++ b/castholm/v0.3.1-3.2.24/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.3.1-3.2.24/json/iostream.json b/castholm/v0.3.1-3.2.24/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/joystick.json b/castholm/v0.3.1-3.2.24/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.3.1-3.2.24/json/joystick.json +++ b/castholm/v0.3.1-3.2.24/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.3.1-3.2.24/json/keyboard.json b/castholm/v0.3.1-3.2.24/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/opengl.json b/castholm/v0.3.1-3.2.24/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/pen.json b/castholm/v0.3.1-3.2.24/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/pixels.json b/castholm/v0.3.1-3.2.24/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.3.1-3.2.24/json/pixels.json +++ b/castholm/v0.3.1-3.2.24/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.3.1-3.2.24/json/power.json b/castholm/v0.3.1-3.2.24/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/process.json b/castholm/v0.3.1-3.2.24/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/scancode.json b/castholm/v0.3.1-3.2.24/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/surface.json b/castholm/v0.3.1-3.2.24/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.3.1-3.2.24/json/surface.json +++ b/castholm/v0.3.1-3.2.24/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.3.1-3.2.24/json/system.json b/castholm/v0.3.1-3.2.24/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.3.1-3.2.24/json/system.json +++ b/castholm/v0.3.1-3.2.24/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.3.1-3.2.24/json/touch.json b/castholm/v0.3.1-3.2.24/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.3.1-3.2.24/json/touch.json +++ b/castholm/v0.3.1-3.2.24/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.3.1-3.2.24/json/tray.json b/castholm/v0.3.1-3.2.24/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.3.1-3.2.24/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.1-3.2.24/json/video.json b/castholm/v0.3.1-3.2.24/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.3.1-3.2.24/json/video.json +++ b/castholm/v0.3.1-3.2.24/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.3.2-3.2.26/api/audio.zig b/castholm/v0.3.2-3.2.26/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.3.2-3.2.26/api/audio.zig +++ b/castholm/v0.3.2-3.2.26/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.3.2-3.2.26/api/blendmode.zig b/castholm/v0.3.2-3.2.26/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.3.2-3.2.26/api/blendmode.zig +++ b/castholm/v0.3.2-3.2.26/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.3.2-3.2.26/api/c.zig b/castholm/v0.3.2-3.2.26/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.3.2-3.2.26/api/camera.zig b/castholm/v0.3.2-3.2.26/api/camera.zig index 80c77b8..4a2c467 100644 --- a/castholm/v0.3.2-3.2.26/api/camera.zig +++ b/castholm/v0.3.2-3.2.26/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.3.2-3.2.26/api/clipboard.zig b/castholm/v0.3.2-3.2.26/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.3.2-3.2.26/api/clipboard.zig +++ b/castholm/v0.3.2-3.2.26/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.3.2-3.2.26/api/dialog.zig b/castholm/v0.3.2-3.2.26/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.3.2-3.2.26/api/dialog.zig +++ b/castholm/v0.3.2-3.2.26/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.3.2-3.2.26/api/error.zig b/castholm/v0.3.2-3.2.26/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.3.2-3.2.26/api/error.zig +++ b/castholm/v0.3.2-3.2.26/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.3.2-3.2.26/api/events.zig b/castholm/v0.3.2-3.2.26/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.3.2-3.2.26/api/events.zig +++ b/castholm/v0.3.2-3.2.26/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.3.2-3.2.26/api/filesystem.zig b/castholm/v0.3.2-3.2.26/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.3.2-3.2.26/api/filesystem.zig +++ b/castholm/v0.3.2-3.2.26/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.3.2-3.2.26/api/gamepad.zig b/castholm/v0.3.2-3.2.26/api/gamepad.zig index 413c625..1f8f790 100644 --- a/castholm/v0.3.2-3.2.26/api/gamepad.zig +++ b/castholm/v0.3.2-3.2.26/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.3.2-3.2.26/api/gpu.zig b/castholm/v0.3.2-3.2.26/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/castholm/v0.3.2-3.2.26/api/gpu.zig +++ b/castholm/v0.3.2-3.2.26/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.3.2-3.2.26/api/guid.zig b/castholm/v0.3.2-3.2.26/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.3.2-3.2.26/api/haptic.zig b/castholm/v0.3.2-3.2.26/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.3.2-3.2.26/api/haptic.zig +++ b/castholm/v0.3.2-3.2.26/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.3.2-3.2.26/api/hints.zig b/castholm/v0.3.2-3.2.26/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.3.2-3.2.26/api/hints.zig +++ b/castholm/v0.3.2-3.2.26/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.3.2-3.2.26/api/init.zig b/castholm/v0.3.2-3.2.26/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.3.2-3.2.26/api/init.zig +++ b/castholm/v0.3.2-3.2.26/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.3.2-3.2.26/api/iostream.zig b/castholm/v0.3.2-3.2.26/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.3.2-3.2.26/api/joystick.zig b/castholm/v0.3.2-3.2.26/api/joystick.zig index 3f57466..a6cee42 100644 --- a/castholm/v0.3.2-3.2.26/api/joystick.zig +++ b/castholm/v0.3.2-3.2.26/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.3.2-3.2.26/api/keyboard.zig b/castholm/v0.3.2-3.2.26/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.3.2-3.2.26/api/keycode.zig b/castholm/v0.3.2-3.2.26/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.3.2-3.2.26/api/keycode.zig +++ b/castholm/v0.3.2-3.2.26/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.3.2-3.2.26/api/loadso.zig b/castholm/v0.3.2-3.2.26/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.3.2-3.2.26/api/loadso.zig +++ b/castholm/v0.3.2-3.2.26/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.3.2-3.2.26/api/messagebox.zig b/castholm/v0.3.2-3.2.26/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.3.2-3.2.26/api/messagebox.zig +++ b/castholm/v0.3.2-3.2.26/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.3.2-3.2.26/api/misc.zig b/castholm/v0.3.2-3.2.26/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.3.2-3.2.26/api/misc.zig +++ b/castholm/v0.3.2-3.2.26/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.3.2-3.2.26/api/mouse.zig b/castholm/v0.3.2-3.2.26/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.3.2-3.2.26/api/mouse.zig +++ b/castholm/v0.3.2-3.2.26/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.3.2-3.2.26/api/opengl.zig b/castholm/v0.3.2-3.2.26/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.3.2-3.2.26/api/pen.zig b/castholm/v0.3.2-3.2.26/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.3.2-3.2.26/api/pixels.zig b/castholm/v0.3.2-3.2.26/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.3.2-3.2.26/api/pixels.zig +++ b/castholm/v0.3.2-3.2.26/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.3.2-3.2.26/api/power.zig b/castholm/v0.3.2-3.2.26/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.3.2-3.2.26/api/process.zig b/castholm/v0.3.2-3.2.26/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.3.2-3.2.26/api/properties.zig b/castholm/v0.3.2-3.2.26/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.3.2-3.2.26/api/properties.zig +++ b/castholm/v0.3.2-3.2.26/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.3.2-3.2.26/api/rect.zig b/castholm/v0.3.2-3.2.26/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.3.2-3.2.26/api/rect.zig +++ b/castholm/v0.3.2-3.2.26/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.3.2-3.2.26/api/render.zig b/castholm/v0.3.2-3.2.26/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.3.2-3.2.26/api/render.zig +++ b/castholm/v0.3.2-3.2.26/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.3.2-3.2.26/api/scancode.zig b/castholm/v0.3.2-3.2.26/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.3.2-3.2.26/api/sensor.zig b/castholm/v0.3.2-3.2.26/api/sensor.zig index cc7fe67..f471675 100644 --- a/castholm/v0.3.2-3.2.26/api/sensor.zig +++ b/castholm/v0.3.2-3.2.26/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.3.2-3.2.26/api/stdinc.zig b/castholm/v0.3.2-3.2.26/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.3.2-3.2.26/api/storage.zig b/castholm/v0.3.2-3.2.26/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.3.2-3.2.26/api/storage.zig +++ b/castholm/v0.3.2-3.2.26/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.3.2-3.2.26/api/surface.zig b/castholm/v0.3.2-3.2.26/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.3.2-3.2.26/api/surface.zig +++ b/castholm/v0.3.2-3.2.26/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.3.2-3.2.26/api/system.zig b/castholm/v0.3.2-3.2.26/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.3.2-3.2.26/api/system.zig +++ b/castholm/v0.3.2-3.2.26/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.3.2-3.2.26/api/time.zig b/castholm/v0.3.2-3.2.26/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.3.2-3.2.26/api/time.zig +++ b/castholm/v0.3.2-3.2.26/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.3.2-3.2.26/api/timer.zig b/castholm/v0.3.2-3.2.26/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.3.2-3.2.26/api/timer.zig +++ b/castholm/v0.3.2-3.2.26/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.3.2-3.2.26/api/touch.zig b/castholm/v0.3.2-3.2.26/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.3.2-3.2.26/api/touch.zig +++ b/castholm/v0.3.2-3.2.26/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.3.2-3.2.26/api/tray.zig b/castholm/v0.3.2-3.2.26/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.3.2-3.2.26/api/version.zig b/castholm/v0.3.2-3.2.26/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.3.2-3.2.26/api/version.zig +++ b/castholm/v0.3.2-3.2.26/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.3.2-3.2.26/api/video.zig b/castholm/v0.3.2-3.2.26/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.3.2-3.2.26/api/video.zig +++ b/castholm/v0.3.2-3.2.26/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.3.2-3.2.26/json/audio.json b/castholm/v0.3.2-3.2.26/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.3.2-3.2.26/json/audio.json +++ b/castholm/v0.3.2-3.2.26/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.3.2-3.2.26/json/blendmode.json b/castholm/v0.3.2-3.2.26/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.3.2-3.2.26/json/blendmode.json +++ b/castholm/v0.3.2-3.2.26/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.3.2-3.2.26/json/events.json b/castholm/v0.3.2-3.2.26/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.3.2-3.2.26/json/events.json +++ b/castholm/v0.3.2-3.2.26/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.3.2-3.2.26/json/filesystem.json b/castholm/v0.3.2-3.2.26/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.3.2-3.2.26/json/filesystem.json +++ b/castholm/v0.3.2-3.2.26/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.3.2-3.2.26/json/gamepad.json b/castholm/v0.3.2-3.2.26/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.3.2-3.2.26/json/gamepad.json +++ b/castholm/v0.3.2-3.2.26/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.3.2-3.2.26/json/gpu.json b/castholm/v0.3.2-3.2.26/json/gpu.json index 2bc908a..e981357 100644 --- a/castholm/v0.3.2-3.2.26/json/gpu.json +++ b/castholm/v0.3.2-3.2.26/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.3.2-3.2.26/json/guid.json b/castholm/v0.3.2-3.2.26/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/haptic.json b/castholm/v0.3.2-3.2.26/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.3.2-3.2.26/json/haptic.json +++ b/castholm/v0.3.2-3.2.26/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.3.2-3.2.26/json/iostream.json b/castholm/v0.3.2-3.2.26/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/joystick.json b/castholm/v0.3.2-3.2.26/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.3.2-3.2.26/json/joystick.json +++ b/castholm/v0.3.2-3.2.26/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.3.2-3.2.26/json/keyboard.json b/castholm/v0.3.2-3.2.26/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/opengl.json b/castholm/v0.3.2-3.2.26/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/pen.json b/castholm/v0.3.2-3.2.26/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/pixels.json b/castholm/v0.3.2-3.2.26/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.3.2-3.2.26/json/pixels.json +++ b/castholm/v0.3.2-3.2.26/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.3.2-3.2.26/json/power.json b/castholm/v0.3.2-3.2.26/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/process.json b/castholm/v0.3.2-3.2.26/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/scancode.json b/castholm/v0.3.2-3.2.26/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/surface.json b/castholm/v0.3.2-3.2.26/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.3.2-3.2.26/json/surface.json +++ b/castholm/v0.3.2-3.2.26/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.3.2-3.2.26/json/system.json b/castholm/v0.3.2-3.2.26/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.3.2-3.2.26/json/system.json +++ b/castholm/v0.3.2-3.2.26/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.3.2-3.2.26/json/touch.json b/castholm/v0.3.2-3.2.26/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.3.2-3.2.26/json/touch.json +++ b/castholm/v0.3.2-3.2.26/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.3.2-3.2.26/json/tray.json b/castholm/v0.3.2-3.2.26/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.3.2-3.2.26/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.2-3.2.26/json/video.json b/castholm/v0.3.2-3.2.26/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.3.2-3.2.26/json/video.json +++ b/castholm/v0.3.2-3.2.26/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.3.3-3.2.28/api/audio.zig b/castholm/v0.3.3-3.2.28/api/audio.zig index 97af535..7a7be11 100644 --- a/castholm/v0.3.3-3.2.28/api/audio.zig +++ b/castholm/v0.3.3-3.2.28/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/castholm/v0.3.3-3.2.28/api/blendmode.zig b/castholm/v0.3.3-3.2.28/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.3.3-3.2.28/api/blendmode.zig +++ b/castholm/v0.3.3-3.2.28/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.3.3-3.2.28/api/c.zig b/castholm/v0.3.3-3.2.28/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.3.3-3.2.28/api/camera.zig b/castholm/v0.3.3-3.2.28/api/camera.zig index 80c77b8..4a2c467 100644 --- a/castholm/v0.3.3-3.2.28/api/camera.zig +++ b/castholm/v0.3.3-3.2.28/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/castholm/v0.3.3-3.2.28/api/clipboard.zig b/castholm/v0.3.3-3.2.28/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/castholm/v0.3.3-3.2.28/api/clipboard.zig +++ b/castholm/v0.3.3-3.2.28/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.3.3-3.2.28/api/dialog.zig b/castholm/v0.3.3-3.2.28/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/castholm/v0.3.3-3.2.28/api/dialog.zig +++ b/castholm/v0.3.3-3.2.28/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.3.3-3.2.28/api/error.zig b/castholm/v0.3.3-3.2.28/api/error.zig index 5fce715..9752b22 100644 --- a/castholm/v0.3.3-3.2.28/api/error.zig +++ b/castholm/v0.3.3-3.2.28/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/castholm/v0.3.3-3.2.28/api/events.zig b/castholm/v0.3.3-3.2.28/api/events.zig index 09ca428..2a900b5 100644 --- a/castholm/v0.3.3-3.2.28/api/events.zig +++ b/castholm/v0.3.3-3.2.28/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/castholm/v0.3.3-3.2.28/api/filesystem.zig b/castholm/v0.3.3-3.2.28/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/castholm/v0.3.3-3.2.28/api/filesystem.zig +++ b/castholm/v0.3.3-3.2.28/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.3.3-3.2.28/api/gamepad.zig b/castholm/v0.3.3-3.2.28/api/gamepad.zig index 413c625..1f8f790 100644 --- a/castholm/v0.3.3-3.2.28/api/gamepad.zig +++ b/castholm/v0.3.3-3.2.28/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.3.3-3.2.28/api/gpu.zig b/castholm/v0.3.3-3.2.28/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/castholm/v0.3.3-3.2.28/api/gpu.zig +++ b/castholm/v0.3.3-3.2.28/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/castholm/v0.3.3-3.2.28/api/guid.zig b/castholm/v0.3.3-3.2.28/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.3.3-3.2.28/api/haptic.zig b/castholm/v0.3.3-3.2.28/api/haptic.zig index 5f82803..2488e5c 100644 --- a/castholm/v0.3.3-3.2.28/api/haptic.zig +++ b/castholm/v0.3.3-3.2.28/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.3.3-3.2.28/api/hints.zig b/castholm/v0.3.3-3.2.28/api/hints.zig index 299b839..862a596 100644 --- a/castholm/v0.3.3-3.2.28/api/hints.zig +++ b/castholm/v0.3.3-3.2.28/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/castholm/v0.3.3-3.2.28/api/init.zig b/castholm/v0.3.3-3.2.28/api/init.zig index 1c0d191..f2f7c11 100644 --- a/castholm/v0.3.3-3.2.28/api/init.zig +++ b/castholm/v0.3.3-3.2.28/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/castholm/v0.3.3-3.2.28/api/iostream.zig b/castholm/v0.3.3-3.2.28/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.3.3-3.2.28/api/joystick.zig b/castholm/v0.3.3-3.2.28/api/joystick.zig index 3f57466..a6cee42 100644 --- a/castholm/v0.3.3-3.2.28/api/joystick.zig +++ b/castholm/v0.3.3-3.2.28/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/castholm/v0.3.3-3.2.28/api/keyboard.zig b/castholm/v0.3.3-3.2.28/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.3.3-3.2.28/api/keycode.zig b/castholm/v0.3.3-3.2.28/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.3.3-3.2.28/api/keycode.zig +++ b/castholm/v0.3.3-3.2.28/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.3.3-3.2.28/api/loadso.zig b/castholm/v0.3.3-3.2.28/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/castholm/v0.3.3-3.2.28/api/loadso.zig +++ b/castholm/v0.3.3-3.2.28/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.3.3-3.2.28/api/messagebox.zig b/castholm/v0.3.3-3.2.28/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/castholm/v0.3.3-3.2.28/api/messagebox.zig +++ b/castholm/v0.3.3-3.2.28/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.3.3-3.2.28/api/misc.zig b/castholm/v0.3.3-3.2.28/api/misc.zig index 189a0fa..c557052 100644 --- a/castholm/v0.3.3-3.2.28/api/misc.zig +++ b/castholm/v0.3.3-3.2.28/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.3.3-3.2.28/api/mouse.zig b/castholm/v0.3.3-3.2.28/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/castholm/v0.3.3-3.2.28/api/mouse.zig +++ b/castholm/v0.3.3-3.2.28/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/castholm/v0.3.3-3.2.28/api/opengl.zig b/castholm/v0.3.3-3.2.28/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.3.3-3.2.28/api/pen.zig b/castholm/v0.3.3-3.2.28/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/castholm/v0.3.3-3.2.28/api/pixels.zig b/castholm/v0.3.3-3.2.28/api/pixels.zig index 906ff2c..654e23c 100644 --- a/castholm/v0.3.3-3.2.28/api/pixels.zig +++ b/castholm/v0.3.3-3.2.28/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/castholm/v0.3.3-3.2.28/api/power.zig b/castholm/v0.3.3-3.2.28/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.3.3-3.2.28/api/process.zig b/castholm/v0.3.3-3.2.28/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.3.3-3.2.28/api/properties.zig b/castholm/v0.3.3-3.2.28/api/properties.zig index 84fae79..5e15c59 100644 --- a/castholm/v0.3.3-3.2.28/api/properties.zig +++ b/castholm/v0.3.3-3.2.28/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/castholm/v0.3.3-3.2.28/api/rect.zig b/castholm/v0.3.3-3.2.28/api/rect.zig index fcc1543..04d56b0 100644 --- a/castholm/v0.3.3-3.2.28/api/rect.zig +++ b/castholm/v0.3.3-3.2.28/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.3.3-3.2.28/api/render.zig b/castholm/v0.3.3-3.2.28/api/render.zig index 8e3717a..0c57be7 100644 --- a/castholm/v0.3.3-3.2.28/api/render.zig +++ b/castholm/v0.3.3-3.2.28/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/castholm/v0.3.3-3.2.28/api/scancode.zig b/castholm/v0.3.3-3.2.28/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.3.3-3.2.28/api/sensor.zig b/castholm/v0.3.3-3.2.28/api/sensor.zig index cc7fe67..f471675 100644 --- a/castholm/v0.3.3-3.2.28/api/sensor.zig +++ b/castholm/v0.3.3-3.2.28/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.3.3-3.2.28/api/stdinc.zig b/castholm/v0.3.3-3.2.28/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.3.3-3.2.28/api/storage.zig b/castholm/v0.3.3-3.2.28/api/storage.zig index e54e948..702db88 100644 --- a/castholm/v0.3.3-3.2.28/api/storage.zig +++ b/castholm/v0.3.3-3.2.28/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.3.3-3.2.28/api/surface.zig b/castholm/v0.3.3-3.2.28/api/surface.zig index 1b61561..fc7f528 100644 --- a/castholm/v0.3.3-3.2.28/api/surface.zig +++ b/castholm/v0.3.3-3.2.28/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/castholm/v0.3.3-3.2.28/api/system.zig b/castholm/v0.3.3-3.2.28/api/system.zig index adb1c4c..2972144 100644 --- a/castholm/v0.3.3-3.2.28/api/system.zig +++ b/castholm/v0.3.3-3.2.28/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.3.3-3.2.28/api/time.zig b/castholm/v0.3.3-3.2.28/api/time.zig index 9e16646..4eff0c3 100644 --- a/castholm/v0.3.3-3.2.28/api/time.zig +++ b/castholm/v0.3.3-3.2.28/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.3.3-3.2.28/api/timer.zig b/castholm/v0.3.3-3.2.28/api/timer.zig index 965e68d..72b8518 100644 --- a/castholm/v0.3.3-3.2.28/api/timer.zig +++ b/castholm/v0.3.3-3.2.28/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/castholm/v0.3.3-3.2.28/api/touch.zig b/castholm/v0.3.3-3.2.28/api/touch.zig index a4a5926..7c54650 100644 --- a/castholm/v0.3.3-3.2.28/api/touch.zig +++ b/castholm/v0.3.3-3.2.28/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.3.3-3.2.28/api/tray.zig b/castholm/v0.3.3-3.2.28/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.3.3-3.2.28/api/version.zig b/castholm/v0.3.3-3.2.28/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.3.3-3.2.28/api/version.zig +++ b/castholm/v0.3.3-3.2.28/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.3.3-3.2.28/api/video.zig b/castholm/v0.3.3-3.2.28/api/video.zig index 664b5d1..b59cc15 100644 --- a/castholm/v0.3.3-3.2.28/api/video.zig +++ b/castholm/v0.3.3-3.2.28/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/castholm/v0.3.3-3.2.28/json/audio.json b/castholm/v0.3.3-3.2.28/json/audio.json index a01869f..ffcb532 100644 --- a/castholm/v0.3.3-3.2.28/json/audio.json +++ b/castholm/v0.3.3-3.2.28/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.3.3-3.2.28/json/blendmode.json b/castholm/v0.3.3-3.2.28/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.3.3-3.2.28/json/blendmode.json +++ b/castholm/v0.3.3-3.2.28/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.3.3-3.2.28/json/events.json b/castholm/v0.3.3-3.2.28/json/events.json index 2698065..916ce18 100644 --- a/castholm/v0.3.3-3.2.28/json/events.json +++ b/castholm/v0.3.3-3.2.28/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.3.3-3.2.28/json/filesystem.json b/castholm/v0.3.3-3.2.28/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.3.3-3.2.28/json/filesystem.json +++ b/castholm/v0.3.3-3.2.28/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.3.3-3.2.28/json/gamepad.json b/castholm/v0.3.3-3.2.28/json/gamepad.json index 0be43f0..7b87127 100644 --- a/castholm/v0.3.3-3.2.28/json/gamepad.json +++ b/castholm/v0.3.3-3.2.28/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.3.3-3.2.28/json/gpu.json b/castholm/v0.3.3-3.2.28/json/gpu.json index 2bc908a..e981357 100644 --- a/castholm/v0.3.3-3.2.28/json/gpu.json +++ b/castholm/v0.3.3-3.2.28/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/castholm/v0.3.3-3.2.28/json/guid.json b/castholm/v0.3.3-3.2.28/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/haptic.json b/castholm/v0.3.3-3.2.28/json/haptic.json index 4689b58..27e1f06 100644 --- a/castholm/v0.3.3-3.2.28/json/haptic.json +++ b/castholm/v0.3.3-3.2.28/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.3.3-3.2.28/json/iostream.json b/castholm/v0.3.3-3.2.28/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/joystick.json b/castholm/v0.3.3-3.2.28/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.3.3-3.2.28/json/joystick.json +++ b/castholm/v0.3.3-3.2.28/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.3.3-3.2.28/json/keyboard.json b/castholm/v0.3.3-3.2.28/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/opengl.json b/castholm/v0.3.3-3.2.28/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/pen.json b/castholm/v0.3.3-3.2.28/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/pixels.json b/castholm/v0.3.3-3.2.28/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/castholm/v0.3.3-3.2.28/json/pixels.json +++ b/castholm/v0.3.3-3.2.28/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.3.3-3.2.28/json/power.json b/castholm/v0.3.3-3.2.28/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/process.json b/castholm/v0.3.3-3.2.28/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/scancode.json b/castholm/v0.3.3-3.2.28/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/surface.json b/castholm/v0.3.3-3.2.28/json/surface.json index 4d48dda..228b300 100644 --- a/castholm/v0.3.3-3.2.28/json/surface.json +++ b/castholm/v0.3.3-3.2.28/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/castholm/v0.3.3-3.2.28/json/system.json b/castholm/v0.3.3-3.2.28/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.3.3-3.2.28/json/system.json +++ b/castholm/v0.3.3-3.2.28/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.3.3-3.2.28/json/touch.json b/castholm/v0.3.3-3.2.28/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.3.3-3.2.28/json/touch.json +++ b/castholm/v0.3.3-3.2.28/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.3.3-3.2.28/json/tray.json b/castholm/v0.3.3-3.2.28/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.3.3-3.2.28/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.3.3-3.2.28/json/video.json b/castholm/v0.3.3-3.2.28/json/video.json index d2761bb..9121bf9 100644 --- a/castholm/v0.3.3-3.2.28/json/video.json +++ b/castholm/v0.3.3-3.2.28/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/castholm/v0.4.0-3.4.0/api/audio.zig b/castholm/v0.4.0-3.4.0/api/audio.zig index 76ea45d..e8689f8 100644 --- a/castholm/v0.4.0-3.4.0/api/audio.zig +++ b/castholm/v0.4.0-3.4.0/api/audio.zig @@ -1,25 +1,25 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV_IO(iostream, closeio, spec, audio_buf, @ptrCast(audio_len)); - } - -}; - -pub const PropertiesID = u32; +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; pub const AudioFormat = enum(c_int) { - audioUnknown = 0x0000u, //Unspecified audio format - audioU8 = 0x0008u, //Unsigned 8-bit samples - audioS8 = 0x8008u, //Signed 8-bit samples - audioS16le = 0x8010u, //Signed 16-bit samples - audioS16be = 0x9010u, //As above, but big-endian byte order - audioS32le = 0x8020u, //32-bit integer samples - audioS32be = 0x9020u, //As above, but big-endian byte order - audioF32le = 0x8120u, //32-bit floating point samples - audioF32be = 0x9120u, //As above, but big-endian byte order + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -32,121 +32,120 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(audiostream); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(audiostream); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(audiostream); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return c.SDL_GetAudioStreamFormat(audiostream, src_spec, dst_spec); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } - pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: *const AudioSpec, dst_spec: *const AudioSpec) bool { - return c.SDL_SetAudioStreamFormat(audiostream, @ptrCast(src_spec), @ptrCast(dst_spec)); + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(audiostream); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return c.SDL_SetAudioStreamFrequencyRatio(audiostream, ratio); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(audiostream); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return c.SDL_SetAudioStreamGain(audiostream, gain); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(audiostream, @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(audiostream, @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamInputChannelMap(audiostream, chmap, count); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamOutputChannelMap(audiostream, chmap, count); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return c.SDL_PutAudioStreamData(audiostream, buf, len); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { - return c.SDL_PutAudioStreamDataNoCopy(audiostream, buf, len, callback, userdata); + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); } - pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const void * const, num_channels: c_int, num_samples: c_int) bool { - return c.SDL_PutAudioStreamPlanarData(audiostream, channel_buffers, num_channels, num_samples); + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(audiostream, buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(audiostream); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(audiostream); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return c.SDL_FlushAudioStream(audiostream); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return c.SDL_ClearAudioStream(audiostream); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_PauseAudioStreamDevice(audiostream); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_ResumeAudioStreamDevice(audiostream); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return c.SDL_AudioStreamDevicePaused(audiostream); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_LockAudioStream(audiostream); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_UnlockAudioStream(audiostream); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamGetCallback(audiostream, callback, userdata); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamPutCallback(audiostream, callback, userdata); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(audiostream); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } - }; pub inline fn getNumAudioDrivers() c_int { @@ -161,48 +160,48 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioPlaybackDevices(@ptrCast(count)); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioRecordingDevices(@ptrCast(count)); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return c.SDL_GetAudioDeviceFormat(devid, spec, @ptrCast(sample_frames)); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } -pub inline fn openAudioDevice(devid: AudioDeviceID, spec: *const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePhysical(devid); + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); } pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePlayback(devid); + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); } pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_PauseAudioDevice(devid); + return @bitCast(c.SDL_PauseAudioDevice(devid)); } pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_ResumeAudioDevice(devid); + return @bitCast(c.SDL_ResumeAudioDevice(devid)); } pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { - return c.SDL_AudioDevicePaused(devid); + return @bitCast(c.SDL_AudioDevicePaused(devid)); } pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { @@ -210,60 +209,63 @@ pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { } pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { - return c.SDL_SetAudioDeviceGain(devid, gain); + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); } pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]*const AudioStream, num_streams: c_int) bool { - return c.SDL_BindAudioStreams(devid, streams, num_streams); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return c.SDL_BindAudioStream(devid, stream); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } -pub inline fn createAudioStream(src_spec: *const AudioSpec, dst_spec: *const AudioSpec) ?*AudioStream { - return c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec)); +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; pub const AudioStreamCallback = c.SDL_AudioStreamCallback; -pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: *const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata); +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioPostmixCallback(devid, callback, userdata); + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV(path, spec, audio_buf, @ptrCast(audio_len)); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return c.SDL_MixAudio(dst, src, @bitCast(format), len, volume); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: *const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: *const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len)); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } - diff --git a/castholm/v0.4.0-3.4.0/api/blendmode.zig b/castholm/v0.4.0-3.4.0/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/castholm/v0.4.0-3.4.0/api/blendmode.zig +++ b/castholm/v0.4.0-3.4.0/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/castholm/v0.4.0-3.4.0/api/c.zig b/castholm/v0.4.0-3.4.0/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.4.0-3.4.0/api/camera.zig b/castholm/v0.4.0-3.4.0/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.4.0-3.4.0/api/clipboard.zig b/castholm/v0.4.0-3.4.0/api/clipboard.zig index 2847baa..6fe8270 100644 --- a/castholm/v0.4.0-3.4.0/api/clipboard.zig +++ b/castholm/v0.4.0-3.4.0/api/clipboard.zig @@ -1,8 +1,7 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { - return c.SDL_SetClipboardText(text); + return @bitCast(c.SDL_SetClipboardText(text)); } pub inline fn getClipboardText() [*c]u8 { @@ -10,11 +9,11 @@ pub inline fn getClipboardText() [*c]u8 { } pub inline fn hasClipboardText() bool { - return c.SDL_HasClipboardText(); + return @bitCast(c.SDL_HasClipboardText()); } pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { - return c.SDL_SetPrimarySelectionText(text); + return @bitCast(c.SDL_SetPrimarySelectionText(text)); } pub inline fn getPrimarySelectionText() [*c]u8 { @@ -22,7 +21,7 @@ pub inline fn getPrimarySelectionText() [*c]u8 { } pub inline fn hasPrimarySelectionText() bool { - return c.SDL_HasPrimarySelectionText(); + return @bitCast(c.SDL_HasPrimarySelectionText()); } pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; @@ -30,21 +29,21 @@ pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { - return c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types); + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); } pub inline fn clearClipboardData() bool { - return c.SDL_ClearClipboardData(); + return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { - return c.SDL_HasClipboardData(mime_type); + return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/castholm/v0.4.0-3.4.0/api/dialog.zig b/castholm/v0.4.0-3.4.0/api/dialog.zig index 17ee2ac..5f94fcf 100644 --- a/castholm/v0.4.0-3.4.0/api/dialog.zig +++ b/castholm/v0.4.0-3.4.0/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -12,16 +13,16 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; -pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location, allow_many); +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } -pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location); +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, window, default_location, allow_many); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/castholm/v0.4.0-3.4.0/api/error.zig b/castholm/v0.4.0-3.4.0/api/error.zig index 1954227..9752b22 100644 --- a/castholm/v0.4.0-3.4.0/api/error.zig +++ b/castholm/v0.4.0-3.4.0/api/error.zig @@ -1,8 +1,12 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { - return c.SDL_OutOfMemory(); + return @bitCast(c.SDL_OutOfMemory()); } pub inline fn getError() [*c]const u8 { @@ -10,5 +14,5 @@ pub inline fn getError() [*c]const u8 { } pub inline fn clearError() bool { - return c.SDL_ClearError(); + return @bitCast(c.SDL_ClearError()); } diff --git a/castholm/v0.4.0-3.4.0/api/events.zig b/castholm/v0.4.0-3.4.0/api/events.zig index 5443d1a..6c62826 100644 --- a/castholm/v0.4.0-3.4.0/api/events.zig +++ b/castholm/v0.4.0-3.4.0/api/events.zig @@ -1,162 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, - rsvd: bool = false, -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -169,7 +55,7 @@ pub const EventType = enum(c_int) { eventDisplayUsableBoundsChanged, //Display has changed usable bounds eventWindowShown = 0x202, //Window has been shown eventWindowHidden, //Window has been hidden - eventWindowExposed, + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. eventWindowMoved, //Window has been moved to data1, data2 eventWindowResized, //Window has been resized to data1xdata2 eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 @@ -190,13 +76,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -229,6 +115,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -260,10 +147,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -326,7 +222,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -424,6 +320,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -712,15 +609,15 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(events, numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { - return c.SDL_HasEvent(_type); + return @bitCast(c.SDL_HasEvent(_type)); } pub inline fn hasEvents(minType: u32, maxType: u32) bool { - return c.SDL_HasEvents(minType, maxType); + return @bitCast(c.SDL_HasEvents(minType, maxType)); } pub inline fn flushEvent(_type: u32) void { @@ -732,19 +629,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return c.SDL_PollEvent(event); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return c.SDL_WaitEvent(event); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return c.SDL_WaitEventTimeout(event, timeoutMS); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return c.SDL_PushEvent(event); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -754,11 +651,11 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return c.SDL_GetEventFilter(filter, userdata); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { - return c.SDL_AddEventWatch(filter, userdata); + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); } pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { @@ -770,21 +667,21 @@ pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn setEventEnabled(_type: u32, enabled: bool) void { - return c.SDL_SetEventEnabled(_type, enabled); + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); } pub inline fn eventEnabled(_type: u32) bool { - return c.SDL_EventEnabled(_type); + return @bitCast(c.SDL_EventEnabled(_type)); } pub inline fn registerEvents(numevents: c_int) u32 { return c.SDL_RegisterEvents(numevents); } -pub inline fn getWindowFromEvent(event: *const Event) ?*Window { - return c.SDL_GetWindowFromEvent(@ptrCast(event)); +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } -pub inline fn getEventDescription(event: *const Event, buf: [*c]u8, buflen: c_int) c_int { - return c.SDL_GetEventDescription(@ptrCast(event), buf, buflen); +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); } diff --git a/castholm/v0.4.0-3.4.0/api/filesystem.zig b/castholm/v0.4.0-3.4.0/api/filesystem.zig index f8ee2d4..48f8e71 100644 --- a/castholm/v0.4.0-3.4.0/api/filesystem.zig +++ b/castholm/v0.4.0-3.4.0/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -49,42 +50,44 @@ pub const GlobFlags = packed struct(u32) { globCaseinsensitive: bool = false, pad0: u30 = 0, rsvd: bool = false, + + pub const None = GlobFlags{}; }; pub inline fn createDirectory(path: [*c]const u8) bool { - return c.SDL_CreateDirectory(path); + return @bitCast(c.SDL_CreateDirectory(path)); } pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateDirectory(path, callback, userdata); + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); } pub inline fn removePath(path: [*c]const u8) bool { - return c.SDL_RemovePath(path); + return @bitCast(c.SDL_RemovePath(path)); } pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_RenamePath(oldpath, newpath); + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); } pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_CopyFile(oldpath, newpath); + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return c.SDL_GetPathInfo(path, info); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/castholm/v0.4.0-3.4.0/api/gamepad.zig b/castholm/v0.4.0-3.4.0/api/gamepad.zig index d3b0070..f3ebe5c 100644 --- a/castholm/v0.4.0-3.4.0/api/gamepad.zig +++ b/castholm/v0.4.0-3.4.0/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(iostream, closeio); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(gamepad); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(gamepad); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(gamepad); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(gamepad); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(gamepad); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(gamepad); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return c.SDL_SetGamepadPlayerIndex(gamepad, player_index); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(gamepad); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(gamepad); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(gamepad); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(gamepad); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(gamepad); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(gamepad); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(gamepad); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(gamepad, @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return c.SDL_GamepadConnected(gamepad); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return c.SDL_GetGamepadJoystick(gamepad); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c][*c]GamepadBinding { - return c.SDL_GetGamepadBindings(gamepad, @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return c.SDL_GamepadHasAxis(gamepad, axis); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(gamepad, axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return c.SDL_GamepadHasButton(gamepad, button); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return c.SDL_GetGamepadButton(gamepad, button); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(gamepad, button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(gamepad); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(gamepad, touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return c.SDL_GetGamepadTouchpadFinger(gamepad, touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure)); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return c.SDL_GamepadHasSensor(gamepad, @intFromEnum(_type)); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return c.SDL_SetGamepadSensorEnabled(gamepad, @intFromEnum(_type), enabled); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return c.SDL_GamepadSensorEnabled(gamepad, @intFromEnum(_type)); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(gamepad, @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return c.SDL_GetGamepadSensorData(gamepad, @intFromEnum(_type), @ptrCast(data), num_values); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleGamepad(gamepad, low_frequency_rumble, high_frequency_rumble, duration_ms); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleGamepadTriggers(gamepad, left_rumble, right_rumble, duration_ms); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return c.SDL_SetGamepadLED(gamepad, red, green, blue); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return c.SDL_SendGamepadEffect(gamepad, data, size); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(gamepad); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(gamepad, button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(gamepad, axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -222,6 +195,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -264,6 +238,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -274,6 +249,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -285,36 +261,40 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } pub inline fn reloadGamepadMappings() bool { - return c.SDL_ReloadGamepadMappings(); + return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { - return c.SDL_SetGamepadMapping(instance_id, mapping); + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); } pub inline fn hasGamepad() bool { - return c.SDL_HasGamepad(); + return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return c.SDL_GetGamepads(@ptrCast(count)); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { - return c.SDL_IsGamepad(instance_id); + return @bitCast(c.SDL_IsGamepad(instance_id)); } pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { @@ -330,7 +310,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -346,11 +326,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -358,23 +338,23 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return c.SDL_OpenGamepad(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return c.SDL_GetGamepadFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return c.SDL_GetGamepadFromPlayerIndex(player_index); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { - return c.SDL_SetGamepadEventsEnabled(enabled); + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); } pub inline fn gamepadEventsEnabled() bool { - return c.SDL_GamepadEventsEnabled(); + return @bitCast(c.SDL_GamepadEventsEnabled()); } pub inline fn updateGamepads() void { @@ -382,29 +362,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/castholm/v0.4.0-3.4.0/debug/SDL_gpu_h_fmterror.zig b/castholm/v0.4.0-3.4.0/api/gpu.zig similarity index 72% rename from castholm/v0.4.0-3.4.0/debug/SDL_gpu_h_fmterror.zig rename to castholm/v0.4.0-3.4.0/api/gpu.zig index f7ba287..5dc12ac 100644 --- a/castholm/v0.4.0-3.4.0/debug/SDL_gpu_h_fmterror.zig +++ b/castholm/v0.4.0-3.4.0/api/gpu.zig @@ -1,199 +1,173 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659u, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949u, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559u, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955u, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659u, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564eu, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564eu, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050u, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454fu, //Android video texture format - pixelformatMjpg = 0x47504a4du, //Motion JPEG -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical = (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL), //flip horizontally and vertically (not a diagonal flip) -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(gpudevice); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(gpudevice); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(gpudevice)); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { - return c.SDL_GetGPUDeviceProperties(gpudevice); + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); } - pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: *const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return c.SDL_CreateGPUComputePipeline(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: *const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return c.SDL_CreateGPUGraphicsPipeline(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: *const GPUSamplerCreateInfo) ?*GPUSampler { - return c.SDL_CreateGPUSampler(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: *const GPUShaderCreateInfo) ?*GPUShader { - return c.SDL_CreateGPUShader(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: *const GPUTextureCreateInfo) ?*GPUTexture { - return c.SDL_CreateGPUTexture(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: *const GPUBufferCreateInfo) ?*GPUBuffer { - return c.SDL_CreateGPUBuffer(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: *const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return c.SDL_CreateGPUTransferBuffer(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(gpudevice, buffer, text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(gpudevice, texture, text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(gpudevice, texture); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(gpudevice, sampler); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(gpudevice, buffer); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(gpudevice, transfer_buffer); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(gpudevice, compute_pipeline); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(gpudevice, shader); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(gpudevice, graphics_pipeline); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return c.SDL_AcquireGPUCommandBuffer(gpudevice); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(gpudevice, transfer_buffer, cycle); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(gpudevice, transfer_buffer); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return c.SDL_WindowSupportsGPUSwapchainComposition(gpudevice, window, swapchain_composition); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return c.SDL_WindowSupportsGPUPresentMode(gpudevice, window, @intFromEnum(present_mode)); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return c.SDL_ClaimWindowForGPUDevice(gpudevice, window); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(gpudevice, window); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return c.SDL_SetGPUSwapchainParameters(gpudevice, window, swapchain_composition, @intFromEnum(present_mode)); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return c.SDL_SetGPUAllowedFramesInFlight(gpudevice, allowed_frames_in_flight); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(gpudevice, window)); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return c.SDL_WaitForGPUSwapchain(gpudevice, window); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return c.SDL_WaitForGPUIdle(gpudevice); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]*const GPUFence, num_fences: u32) bool { - return c.SDL_WaitForGPUFences(gpudevice, wait_all, fences, num_fences); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return c.SDL_QueryGPUFence(gpudevice, fence); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(gpudevice, fence); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return c.SDL_GPUTextureSupportsFormat(gpudevice, @bitCast(format), @intFromEnum(_type), @bitCast(usage)); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return c.SDL_GPUTextureSupportsSampleCount(gpudevice, @bitCast(format), sample_count); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(gpudevice); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(gpudevice); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -213,201 +187,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(gpucommandbuffer, text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(gpucommandbuffer, name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(gpucommandbuffer); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } - pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: *const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: *const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return c.SDL_BeginGPURenderPass(gpucommandbuffer, @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info)); + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } - pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: *const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: *const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return c.SDL_BeginGPUComputePass(gpucommandbuffer, @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings); + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return c.SDL_BeginGPUCopyPass(gpucommandbuffer); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(gpucommandbuffer, texture); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } - pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: *const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(gpucommandbuffer, @ptrCast(info)); + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c][*c]GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return c.SDL_AcquireGPUSwapchainTexture(gpucommandbuffer, window, swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height)); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c][*c]GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return c.SDL_WaitAndAcquireGPUSwapchainTexture(gpucommandbuffer, window, swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height)); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return c.SDL_SubmitGPUCommandBuffer(gpucommandbuffer); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return c.SDL_SubmitGPUCommandBufferAndAcquireFence(gpucommandbuffer); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return c.SDL_CancelGPUCommandBuffer(gpucommandbuffer); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(gpurenderpass, graphics_pipeline); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } - pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: *const GPUViewport) void { - return c.SDL_SetGPUViewport(gpurenderpass, @ptrCast(viewport)); + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } - pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: *const Rect) void { - return c.SDL_SetGPUScissor(gpurenderpass, @ptrCast(scissor)); + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(gpurenderpass, blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(gpurenderpass, reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } - pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: *const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(gpurenderpass, first_slot, @ptrCast(bindings), num_bindings); + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } - pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: *const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(gpurenderpass, @ptrCast(binding), index_element_size); + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } - pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(gpurenderpass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(gpurenderpass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(gpurenderpass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } - pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(gpurenderpass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(gpurenderpass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(gpurenderpass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(gpurenderpass, num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(gpurenderpass, num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(gpurenderpass, buffer, offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(gpurenderpass, buffer, offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(gpurenderpass); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(gpucomputepass, compute_pipeline); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } - pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(gpucomputepass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(gpucomputepass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(gpucomputepass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(gpucomputepass, groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(gpucomputepass, buffer, offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(gpucomputepass); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { - pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureTransferInfo, destination: *const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(gpucopypass, @ptrCast(source), @ptrCast(destination), cycle); + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } - pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: *const GPUTransferBufferLocation, destination: *const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination), cycle); + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } - pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureLocation, destination: *const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(gpucopypass, @ptrCast(source), @ptrCast(destination), w, h, d, cycle); + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } - pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: *const GPUBufferLocation, destination: *const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination), size, cycle); + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } - pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureRegion, destination: *const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(gpucopypass, @ptrCast(source), @ptrCast(destination)); + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } - pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: *const GPUBufferRegion, destination: *const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination)); + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(gpucopypass); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -557,6 +531,8 @@ pub const GPUTextureUsageFlags = packed struct(u32) { textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. pad0: u24 = 0, rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; }; pub const GPUTextureType = enum(c_int) { @@ -592,6 +568,8 @@ pub const GPUBufferUsageFlags = packed struct(u32) { bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. pad0: u25 = 0, rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; }; pub const GPUTransferBufferUsage = enum(c_int) { @@ -604,7 +582,18 @@ pub const GPUShaderStage = enum(c_int) { shaderstageFragment, }; -pub const GPUShaderFormat = u32; +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; pub const GPUVertexElementFormat = enum(c_int) { vertexelementformatInvalid, @@ -691,7 +680,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -708,7 +697,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -718,6 +707,8 @@ pub const GPUColorComponentFlags = packed struct(u8) { colorcomponentA: bool = false, // the alpha component pad0: u3 = 0, rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; }; pub const GPUFilter = enum(c_int) { @@ -867,9 +858,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: *const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: *const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -973,7 +964,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: *const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1082,19 +1073,19 @@ pub const GPUStorageTextureReadWriteBinding = extern struct { }; pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { - return c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name); + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); } pub inline fn gpuSupportsProperties(props: PropertiesID) bool { - return c.SDL_GPUSupportsProperties(props); + return @bitCast(c.SDL_GPUSupportsProperties(props)); } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return c.SDL_CreateGPUDevice(@bitCast(format_flags), debug_mode, name); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return c.SDL_CreateGPUDeviceWithProperties(props); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub const GPUVulkanOptions = extern struct { @@ -1116,17 +1107,17 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@bitCast(format))); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); } pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@bitCast(format))); + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); } diff --git a/castholm/v0.4.0-3.4.0/api/guid.zig b/castholm/v0.4.0-3.4.0/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.4.0-3.4.0/api/haptic.zig b/castholm/v0.4.0-3.4.0/api/haptic.zig index eeeeda1..018f434 100644 --- a/castholm/v0.4.0-3.4.0/api/haptic.zig +++ b/castholm/v0.4.0-3.4.0/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return c.SDL_IsJoystickHaptic(joystick); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return c.SDL_OpenHapticFromJoystick(joystick); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(haptic); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(haptic); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(haptic); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(haptic); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(haptic); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(haptic); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(haptic); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } - pub inline fn hapticEffectSupported(haptic: *Haptic, effect: *const HapticEffect) bool { - return c.SDL_HapticEffectSupported(haptic, @ptrCast(effect)); + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } - pub inline fn createHapticEffect(haptic: *Haptic, effect: *const HapticEffect) HapticEffectID { - return c.SDL_CreateHapticEffect(haptic, @ptrCast(effect)); + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } - pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: *const HapticEffect) bool { - return c.SDL_UpdateHapticEffect(haptic, effect, @ptrCast(data)); + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { - return c.SDL_RunHapticEffect(haptic, effect, iterations); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { - return c.SDL_StopHapticEffect(haptic, effect); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { - return c.SDL_DestroyHapticEffect(haptic, effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { - return c.SDL_GetHapticEffectStatus(haptic, effect); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return c.SDL_SetHapticGain(haptic, gain); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return c.SDL_SetHapticAutocenter(haptic, autocenter); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return c.SDL_PauseHaptic(haptic); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return c.SDL_ResumeHaptic(haptic); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return c.SDL_StopHapticEffects(haptic); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return c.SDL_HapticRumbleSupported(haptic); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return c.SDL_InitHapticRumble(haptic); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return c.SDL_PlayHapticRumble(haptic, strength, length); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return c.SDL_StopHapticRumble(haptic); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -131,6 +124,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: HapticEffectType, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -147,6 +141,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: HapticEffectType, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -192,7 +187,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -211,8 +206,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return c.SDL_GetHaptics(@ptrCast(count)); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -220,17 +215,25 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return c.SDL_OpenHaptic(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return c.SDL_GetHapticFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { - return c.SDL_IsMouseHaptic(); + return @bitCast(c.SDL_IsMouseHaptic()); } pub inline fn openHapticFromMouse() ?*Haptic { - return c.SDL_OpenHapticFromMouse(); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/castholm/v0.4.0-3.4.0/api/hints.zig b/castholm/v0.4.0-3.4.0/api/hints.zig index 991da86..862a596 100644 --- a/castholm/v0.4.0-3.4.0/api/hints.zig +++ b/castholm/v0.4.0-3.4.0/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,15 +7,15 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return c.SDL_SetHintWithPriority(name, value, priority); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetHint(name, value); + return @bitCast(c.SDL_SetHint(name, value)); } pub inline fn resetHint(name: [*c]const u8) bool { - return c.SDL_ResetHint(name); + return @bitCast(c.SDL_ResetHint(name)); } pub inline fn resetHints() void { @@ -28,13 +27,13 @@ pub inline fn getHint(name: [*c]const u8) [*c]const u8 { } pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { - return c.SDL_GetHintBoolean(name, default_value); + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); } pub const HintCallback = c.SDL_HintCallback; pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { - return c.SDL_AddHintCallback(name, callback, userdata); + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); } pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { diff --git a/castholm/v0.4.0-3.4.0/api/init.zig b/castholm/v0.4.0-3.4.0/api/init.zig index c34d6df..f2f7c11 100644 --- a/castholm/v0.4.0-3.4.0/api/init.zig +++ b/castholm/v0.4.0-3.4.0/api/init.zig @@ -1,17 +1,21 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, + + pub const None = InitFlags{}; }; pub const AppResult = enum(c_int) { @@ -29,11 +33,11 @@ pub const AppEvent_func = c.SDL_AppEvent_func; pub const AppQuit_func = c.SDL_AppQuit_func; pub inline fn init(flags: InitFlags) bool { - return c.SDL_Init(@bitCast(flags)); + return @bitCast(c.SDL_Init(@bitCast(flags))); } pub inline fn initSubSystem(flags: InitFlags) bool { - return c.SDL_InitSubSystem(@bitCast(flags)); + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); } pub inline fn quitSubSystem(flags: InitFlags) void { @@ -49,21 +53,21 @@ pub inline fn quit() void { } pub inline fn isMainThread() bool { - return c.SDL_IsMainThread(); + return @bitCast(c.SDL_IsMainThread()); } pub const MainThreadCallback = c.SDL_MainThreadCallback; pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { - return c.SDL_RunOnMainThread(callback, userdata, wait_complete); + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); } pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { - return c.SDL_SetAppMetadata(appname, appversion, appidentifier); + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); } pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetAppMetadataProperty(name, value); + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); } pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { diff --git a/castholm/v0.4.0-3.4.0/api/iostream.zig b/castholm/v0.4.0-3.4.0/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.4.0-3.4.0/api/joystick.zig b/castholm/v0.4.0-3.4.0/api/joystick.zig index f5395e9..a6cee42 100644 --- a/castholm/v0.4.0-3.4.0/api/joystick.zig +++ b/castholm/v0.4.0-3.4.0/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return c.SDL_SetJoystickVirtualAxis(joystick, axis, value); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return c.SDL_SetJoystickVirtualBall(joystick, ball, xrel, yrel); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return c.SDL_SetJoystickVirtualButton(joystick, button, down); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return c.SDL_SetJoystickVirtualHat(joystick, hat, value); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return c.SDL_SetJoystickVirtualTouchpad(joystick, touchpad, finger, down, x, y, pressure); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return c.SDL_SendJoystickVirtualSensorData(joystick, @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(joystick); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(joystick); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(joystick); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(joystick); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return c.SDL_SetJoystickPlayerIndex(joystick, player_index); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(joystick); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(joystick); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(joystick); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(joystick); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(joystick); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(joystick); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return c.SDL_JoystickConnected(joystick); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(joystick); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(joystick); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(joystick); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(joystick); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(joystick); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(joystick, axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return c.SDL_GetJoystickAxisInitialState(joystick, axis, @ptrCast(state)); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return c.SDL_GetJoystickBall(joystick, ball, @ptrCast(dx), @ptrCast(dy)); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(joystick, hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return c.SDL_GetJoystickButton(joystick, button); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return c.SDL_SetJoystickLED(joystick, red, green, blue); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return c.SDL_SendJoystickEffect(joystick, data, size); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(joystick); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(joystick); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(joystick, @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -205,11 +188,11 @@ pub inline fn unlockJoysticks() void { } pub inline fn hasJoystick() bool { - return c.SDL_HasJoystick(); + return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return c.SDL_GetJoysticks(@ptrCast(count)); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return c.SDL_OpenJoystick(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return c.SDL_GetJoystickFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return c.SDL_GetJoystickFromPlayerIndex(player_index); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,42 +262,44 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: *const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: *const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; -pub inline fn attachVirtualJoystick(desc: *const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { - return c.SDL_DetachVirtualJoystick(instance_id); + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); } pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { - return c.SDL_IsJoystickVirtual(instance_id); + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { - return c.SDL_SetJoystickEventsEnabled(enabled); + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); } pub inline fn joystickEventsEnabled() bool { - return c.SDL_JoystickEventsEnabled(); + return @bitCast(c.SDL_JoystickEventsEnabled()); } pub inline fn updateJoysticks() void { diff --git a/castholm/v0.4.0-3.4.0/api/keyboard.zig b/castholm/v0.4.0-3.4.0/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.4.0-3.4.0/api/keycode.zig b/castholm/v0.4.0-3.4.0/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/castholm/v0.4.0-3.4.0/api/keycode.zig +++ b/castholm/v0.4.0-3.4.0/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/castholm/v0.4.0-3.4.0/api/loadso.zig b/castholm/v0.4.0-3.4.0/api/loadso.zig index 6bf3894..aa318c0 100644 --- a/castholm/v0.4.0-3.4.0/api/loadso.zig +++ b/castholm/v0.4.0-3.4.0/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(sharedobject, name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(sharedobject); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return c.SDL_LoadObject(sofile); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/castholm/v0.4.0-3.4.0/api/messagebox.zig b/castholm/v0.4.0-3.4.0/api/messagebox.zig index b7820eb..84c5f01 100644 --- a/castholm/v0.4.0-3.4.0/api/messagebox.zig +++ b/castholm/v0.4.0-3.4.0/api/messagebox.zig @@ -1,16 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, + + pub const None = MessageBoxFlags{}; }; pub const MessageBoxButtonFlags = packed struct(u32) { @@ -18,6 +22,8 @@ pub const MessageBoxButtonFlags = packed struct(u32) { messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit pad0: u29 = 0, rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; }; pub const MessageBoxButtonData = extern struct { @@ -51,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: *const MessageBoxButtonData, - colorScheme: *const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: *const MessageBoxData, buttonid: *c_int) bool { - return c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid)); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, window); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/castholm/v0.4.0-3.4.0/api/misc.zig b/castholm/v0.4.0-3.4.0/api/misc.zig index 2bcc6d5..c557052 100644 --- a/castholm/v0.4.0-3.4.0/api/misc.zig +++ b/castholm/v0.4.0-3.4.0/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { - return c.SDL_OpenURL(url); + return @bitCast(c.SDL_OpenURL(url)); } diff --git a/castholm/v0.4.0-3.4.0/api/mouse.zig b/castholm/v0.4.0-3.4.0/api/mouse.zig index 5d6a5d0..08095af 100644 --- a/castholm/v0.4.0-3.4.0/api/mouse.zig +++ b/castholm/v0.4.0-3.4.0/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(window, x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return c.SDL_SetWindowRelativeMouseMode(window, enabled); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return c.SDL_GetWindowRelativeMouseMode(window); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateColorCursor(surface, hot_x, hot_y); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return c.SDL_SetCursor(cursor); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(cursor); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -73,16 +58,20 @@ pub const MouseButtonFlags = packed struct(u32) { buttonX1: bool = false, pad0: u28 = 0, rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); }; pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; pub inline fn hasMouse() bool { - return c.SDL_HasMouse(); + return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return c.SDL_GetMice(@ptrCast(count)); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -90,61 +79,77 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return c.SDL_GetMouseFocus(); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { - return c.SDL_WarpMouseGlobal(x, y); + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetRelativeMouseTransform(callback, userdata); + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); } pub inline fn captureMouse(enabled: bool) bool { - return c.SDL_CaptureMouse(enabled); + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateAnimatedCursor(frames, frame_count, hot_x, hot_y); + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return c.SDL_CreateSystemCursor(id); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return c.SDL_GetCursor(); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return c.SDL_GetDefaultCursor(); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { - return c.SDL_ShowCursor(); + return @bitCast(c.SDL_ShowCursor()); } pub inline fn hideCursor() bool { - return c.SDL_HideCursor(); + return @bitCast(c.SDL_HideCursor()); } pub inline fn cursorVisible() bool { - return c.SDL_CursorVisible(); + return @bitCast(c.SDL_CursorVisible()); } diff --git a/castholm/v0.4.0-3.4.0/api/opengl.zig b/castholm/v0.4.0-3.4.0/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.4.0-3.4.0/api/pen.zig b/castholm/v0.4.0-3.4.0/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.4.0-3.4.0/api/pixels.zig b/castholm/v0.4.0-3.4.0/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.4.0-3.4.0/api/power.zig b/castholm/v0.4.0-3.4.0/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.4.0-3.4.0/api/process.zig b/castholm/v0.4.0-3.4.0/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.4.0-3.4.0/api/properties.zig b/castholm/v0.4.0-3.4.0/api/properties.zig index 56e3ac8..5e15c59 100644 --- a/castholm/v0.4.0-3.4.0/api/properties.zig +++ b/castholm/v0.4.0-3.4.0/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -21,11 +20,11 @@ pub inline fn createProperties() PropertiesID { } pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { - return c.SDL_CopyProperties(src, dst); + return @bitCast(c.SDL_CopyProperties(src, dst)); } pub inline fn lockProperties(props: PropertiesID) bool { - return c.SDL_LockProperties(props); + return @bitCast(c.SDL_LockProperties(props)); } pub inline fn unlockProperties(props: PropertiesID) void { @@ -35,35 +34,35 @@ pub inline fn unlockProperties(props: PropertiesID) void { pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata); + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); } pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { - return c.SDL_SetPointerProperty(props, name, value); + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); } pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetStringProperty(props, name, value); + return @bitCast(c.SDL_SetStringProperty(props, name, value)); } pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { - return c.SDL_SetNumberProperty(props, name, value); + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); } pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { - return c.SDL_SetFloatProperty(props, name, value); + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); } pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { - return c.SDL_SetBooleanProperty(props, name, value); + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); } pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { - return c.SDL_HasProperty(props, name); + return @bitCast(c.SDL_HasProperty(props, name)); } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { @@ -83,17 +82,17 @@ pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_ } pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { - return c.SDL_GetBooleanProperty(props, name, default_value); + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); } pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { - return c.SDL_ClearProperty(props, name); + return @bitCast(c.SDL_ClearProperty(props, name)); } pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateProperties(props, callback, userdata); + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); } pub inline fn destroyProperties(props: PropertiesID) void { diff --git a/castholm/v0.4.0-3.4.0/api/rect.zig b/castholm/v0.4.0-3.4.0/api/rect.zig index ab3d595..04d56b0 100644 --- a/castholm/v0.4.0-3.4.0/api/rect.zig +++ b/castholm/v0.4.0-3.4.0/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -25,42 +24,42 @@ pub const FRect = extern struct { h: f32, }; -pub inline fn hasRectIntersection(A: *const Rect, B: *const Rect) bool { - return c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B)); +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } -pub inline fn getRectIntersection(A: *const Rect, B: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectUnion(A: *const Rect, B: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectEnclosingPoints(points: *const Point, count: c_int, clip: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), result); +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: *const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2)); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } -pub inline fn hasRectIntersectionFloat(A: *const FRect, B: *const FRect) bool { - return c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B)); +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } -pub inline fn getRectIntersectionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectUnionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectEnclosingPointsFloat(points: *const FPoint, count: c_int, clip: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), result); +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: *const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2)); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/castholm/v0.4.0-3.4.0/api/render.zig b/castholm/v0.4.0-3.4.0/api/render.zig new file mode 100644 index 0000000..1afb792 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.4.0-3.4.0/api/scancode.zig b/castholm/v0.4.0-3.4.0/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.4.0-3.4.0/api/sensor.zig b/castholm/v0.4.0-3.4.0/api/sensor.zig index 9068d9d..f471675 100644 --- a/castholm/v0.4.0-3.4.0/api/sensor.zig +++ b/castholm/v0.4.0-3.4.0/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(sensor); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(sensor); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(sensor)); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(sensor); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(sensor); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return c.SDL_GetSensorData(sensor, @ptrCast(data), num_values); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(sensor); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return c.SDL_GetSensors(@ptrCast(count)); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return c.SDL_OpenSensor(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return c.SDL_GetSensorFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/castholm/v0.4.0-3.4.0/api/stdinc.zig b/castholm/v0.4.0-3.4.0/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.4.0-3.4.0/api/storage.zig b/castholm/v0.4.0-3.4.0/api/storage.zig index 37100c3..702db88 100644 --- a/castholm/v0.4.0-3.4.0/api/storage.zig +++ b/castholm/v0.4.0-3.4.0/api/storage.zig @@ -1,114 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return c.SDL_CloseStorage(storage); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return c.SDL_StorageReady(storage); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return c.SDL_GetStorageFileSize(storage, path, @ptrCast(length)); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return c.SDL_ReadStorageFile(storage, path, destination, length); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return c.SDL_WriteStorageFile(storage, path, source, length); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return c.SDL_CreateStorageDirectory(storage, path); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateStorageDirectory(storage, path, callback, userdata); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return c.SDL_RemoveStoragePath(storage, path); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_RenameStoragePath(storage, oldpath, newpath); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_CopyStorageFile(storage, oldpath, newpath); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return c.SDL_GetStoragePathInfo(storage, path, info); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(storage); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(storage, path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return c.SDL_OpenTitleStorage(override, props); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return c.SDL_OpenUserStorage(org, app, props); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return c.SDL_OpenFileStorage(path); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } -pub inline fn openStorage(iface: *const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return c.SDL_OpenStorage(@ptrCast(iface), userdata); +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/castholm/v0.4.0-3.4.0/api/surface.zig b/castholm/v0.4.0-3.4.0/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.4.0-3.4.0/api/system.zig b/castholm/v0.4.0-3.4.0/api/system.zig index 8863cba..2972144 100644 --- a/castholm/v0.4.0-3.4.0/api/system.zig +++ b/castholm/v0.4.0-3.4.0/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return c.SDL_SetiOSAnimationCallback(window, interval, callback, callbackParam); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex)); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -32,17 +28,21 @@ pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) voi } pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { - return c.SDL_SetLinuxThreadPriority(threadID, priority); + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); } pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { - return c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy); + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); } pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { - return c.SDL_SetiOSEventPump(enabled); + return c.SDL_SetiOSEventPump(@bitCast(enabled)); } pub inline fn getAndroidJNIEnv() ?*anyopaque { @@ -58,11 +58,11 @@ pub inline fn getAndroidSDKVersion() c_int { } pub inline fn isChromebook() bool { - return c.SDL_IsChromebook(); + return @bitCast(c.SDL_IsChromebook()); } pub inline fn isDeXMode() bool { - return c.SDL_IsDeXMode(); + return @bitCast(c.SDL_IsDeXMode()); } pub inline fn sendAndroidBackButton() void { @@ -88,26 +88,27 @@ pub inline fn getAndroidCachePath() [*c]const u8 { pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { - return c.SDL_RequestAndroidPermission(permission, cb, userdata); + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); } pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { - return c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset); + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); } pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { - return c.SDL_SendAndroidMessage(command, param); + return @bitCast(c.SDL_SendAndroidMessage(command, param)); } pub inline fn isTablet() bool { - return c.SDL_IsTablet(); + return @bitCast(c.SDL_IsTablet()); } pub inline fn isTV() bool { - return c.SDL_IsTV(); + return @bitCast(c.SDL_IsTV()); } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return c.SDL_GetGDKTaskQueue(outTaskQueue); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return c.SDL_GetGDKDefaultUser(outUserHandle); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/castholm/v0.4.0-3.4.0/api/time.zig b/castholm/v0.4.0-3.4.0/api/time.zig index 3270ed1..4eff0c3 100644 --- a/castholm/v0.4.0-3.4.0/api/time.zig +++ b/castholm/v0.4.0-3.4.0/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return c.SDL_GetDateTimeLocalePreferences(@bitCast(dateFormat), @bitCast(timeFormat)); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return c.SDL_GetCurrentTime(ticks); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return c.SDL_TimeToDateTime(ticks, dt, localTime); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } -pub inline fn dateTimeToTime(dt: *const DateTime, ticks: ?*Time) bool { - return c.SDL_DateTimeToTime(@ptrCast(dt), ticks); +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/castholm/v0.4.0-3.4.0/api/timer.zig b/castholm/v0.4.0-3.4.0/api/timer.zig index 3300d85..72b8518 100644 --- a/castholm/v0.4.0-3.4.0/api/timer.zig +++ b/castholm/v0.4.0-3.4.0/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } @@ -44,5 +43,5 @@ pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*a } pub inline fn removeTimer(id: TimerID) bool { - return c.SDL_RemoveTimer(id); + return @bitCast(c.SDL_RemoveTimer(id)); } diff --git a/castholm/v0.4.0-3.4.0/api/touch.zig b/castholm/v0.4.0-3.4.0/api/touch.zig index 2394cdc..7c54650 100644 --- a/castholm/v0.4.0-3.4.0/api/touch.zig +++ b/castholm/v0.4.0-3.4.0/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return c.SDL_GetTouchDevices(@ptrCast(count)); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c][*c]Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/castholm/v0.4.0-3.4.0/api/tray.zig b/castholm/v0.4.0-3.4.0/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.4.0-3.4.0/api/version.zig b/castholm/v0.4.0-3.4.0/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/castholm/v0.4.0-3.4.0/api/version.zig +++ b/castholm/v0.4.0-3.4.0/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/castholm/v0.4.0-3.4.0/api/video.zig b/castholm/v0.4.0-3.4.0/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.4.0-3.4.0/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.4.0-3.4.0/debug/SDL_camera_h_fmterror.zig b/castholm/v0.4.0-3.4.0/debug/SDL_camera_h_fmterror.zig deleted file mode 100644 index e36a5e0..0000000 --- a/castholm/v0.4.0-3.4.0/debug/SDL_camera_h_fmterror.zig +++ /dev/null @@ -1,132 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659u, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949u, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559u, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955u, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659u, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564eu, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564eu, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050u, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454fu, //Android video texture format - pixelformatMjpg = 0x47504a4du, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault = SDL_COLORSPACE_SRGB, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault = SDL_COLORSPACE_BT601_LIMITED, //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; - -pub const CameraID = u32; - -pub const Camera = opaque { - pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { - return c.SDL_GetCameraPermissionState(camera); - } - - pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(camera); - } - - pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(camera); - } - - pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return c.SDL_GetCameraFormat(camera, spec); - } - - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return c.SDL_AcquireCameraFrame(camera, @ptrCast(timestampNS)); - } - - pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(camera, frame); - } - - pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(camera); - } -}; - -pub const CameraSpec = extern struct { - format: PixelFormat, // Frame format - colorspace: Colorspace, // Frame colorspace - width: c_int, // Frame width - height: c_int, // Frame height - framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) - framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) -}; - -pub const CameraPosition = enum(c_int) { - cameraPositionUnknown, - cameraPositionFrontFacing, - cameraPositionBackFacing, -}; - -pub const CameraPermissionState = enum(c_int) { - cameraPermissionStatePending, - cameraPermissionStateApproved, -}; - -pub inline fn getNumCameraDrivers() c_int { - return c.SDL_GetNumCameraDrivers(); -} - -pub inline fn getCameraDriver(index: c_int) [*c]const u8 { - return c.SDL_GetCameraDriver(index); -} - -pub inline fn getCurrentCameraDriver() [*c]const u8 { - return c.SDL_GetCurrentCameraDriver(); -} - -pub inline fn getCameras(count: *c_int) ?*CameraID { - return c.SDL_GetCameras(@ptrCast(count)); -} - -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c][*c]CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); -} - -pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { - return c.SDL_GetCameraName(instance_id); -} - -pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); -} - -pub inline fn openCamera(instance_id: CameraID, spec: *const CameraSpec) ?*Camera { - return c.SDL_OpenCamera(instance_id, @ptrCast(spec)); -} diff --git a/castholm/v0.4.0-3.4.0/debug/SDL_pixels_h_fmterror.zig b/castholm/v0.4.0-3.4.0/debug/SDL_pixels_h_fmterror.zig deleted file mode 100644 index c2abb28..0000000 --- a/castholm/v0.4.0-3.4.0/debug/SDL_pixels_h_fmterror.zig +++ /dev/null @@ -1,238 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const PixelType = enum(c_int) { - pixeltypeUnknown, - pixeltypeIndex1, - pixeltypeIndex4, - pixeltypeIndex8, - pixeltypePacked8, - pixeltypePacked16, - pixeltypePacked32, - pixeltypeArrayu8, - pixeltypeArrayu16, - pixeltypeArrayu32, - pixeltypeArrayf16, - pixeltypeArrayf32, - pixeltypeIndex2, -}; - -pub const BitmapOrder = enum(c_int) { - bitmaporderNone, - bitmaporder4321, - bitmaporder1234, -}; - -pub const PackedOrder = enum(c_int) { - packedorderNone, - packedorderXrgb, - packedorderRgbx, - packedorderArgb, - packedorderRgba, - packedorderXbgr, - packedorderBgrx, - packedorderAbgr, - packedorderBgra, -}; - -pub const ArrayOrder = enum(c_int) { - arrayorderNone, - arrayorderRgb, - arrayorderRgba, - arrayorderArgb, - arrayorderBgr, - arrayorderBgra, - arrayorderAbgr, -}; - -pub const PackedLayout = enum(c_int) { - packedlayoutNone, - packedlayout332, - packedlayout4444, - packedlayout1555, - packedlayout5551, - packedlayout565, - packedlayout8888, - packedlayout2101010, - packedlayout1010102, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659u, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949u, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559u, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955u, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659u, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564eu, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564eu, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050u, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454fu, //Android video texture format - pixelformatMjpg = 0x47504a4du, //Motion JPEG -}; - -pub const ColorRange = enum(c_int) { - colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, -}; - -pub const ColorPrimaries = enum(c_int) { - colorPrimariesBt709 = 1, //ITU-R BT.709-6 - colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M - colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 - colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M - colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 - colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) - colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 - colorPrimariesXyz = 10, //SMPTE ST 428-1 - colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 - colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 - colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E -}; - -pub const TransferCharacteristics = enum(c_int) { - transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 - transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM - transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G - transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 - transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M - transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 - transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut - transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) - transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system - transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system - transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems - transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 - transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) -}; - -pub const MatrixCoefficients = enum(c_int) { - matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 - matrixCoefficientsFcc = 4, //US FCC Title 47 - matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 - matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 - matrixCoefficientsSmpte240 = 7, //SMPTE 240M - matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance - matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance - matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 - matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP -}; - -pub const ChromaLocation = enum(c_int) { - chromaLocationNone = 0, //RGB, no chroma sampling - chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. - chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault = SDL_COLORSPACE_SRGB, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault = SDL_COLORSPACE_BT601_LIMITED, //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const PixelFormatDetails = extern struct { - format: PixelFormat, - bits_per_pixel: u8, - bytes_per_pixel: u8, - padding: [2]u8, - Rmask: u32, - Gmask: u32, - Bmask: u32, - Amask: u32, - Rbits: u8, - Gbits: u8, - Bbits: u8, - Abits: u8, - Rshift: u8, - Gshift: u8, - Bshift: u8, - Ashift: u8, -}; - -pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); -} - -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask)); -} - -pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); -} - -pub inline fn getPixelFormatDetails(format: PixelFormat) *const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); -} - -pub inline fn createPalette(ncolors: c_int) ?*Palette { - return c.SDL_CreatePalette(ncolors); -} - -pub inline fn setPaletteColors(palette: ?*Palette, colors: *const Color, firstcolor: c_int, ncolors: c_int) bool { - return c.SDL_SetPaletteColors(palette, @ptrCast(colors), firstcolor, ncolors); -} - -pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(palette); -} - -pub inline fn mapRGB(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); -} - -pub inline fn mapRGBA(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); -} - -pub inline fn getRGB(pixelvalue: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b); -} - -pub inline fn getRGBA(pixelvalue: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b, a); -} diff --git a/castholm/v0.4.0-3.4.0/debug/SDL_render_h_fmterror.zig b/castholm/v0.4.0-3.4.0/debug/SDL_render_h_fmterror.zig deleted file mode 100644 index a2b0543..0000000 --- a/castholm/v0.4.0-3.4.0/debug/SDL_render_h_fmterror.zig +++ /dev/null @@ -1,1267 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return c.SDL_CreateSoftwareRenderer(surface); - } -}; - -pub const PropertiesID = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return c.SDL_CreateRenderer(window, name); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return c.SDL_GetRenderer(window); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const GPUTextureSamplerBinding = extern struct { - texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. - sampler: ?*GPUSampler, // The sampler to bind. -}; - -pub const GPUSampler = opaque {}; - -pub const GPUTexture = opaque {}; - -pub const GPUShader = opaque {}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u37 = 0, - rsvd: bool = false, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659u, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949u, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559u, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955u, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659u, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564eu, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564eu, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050u, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454fu, //Android video texture format - pixelformatMjpg = 0x47504a4du, //Motion JPEG -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering - scalemodePixelart, -}; - -pub const GPUDevice = opaque { - pub inline fn createGPURenderer(gpudevice: *GPUDevice, window: ?*Window) ?*Renderer { - return c.SDL_CreateGPURenderer(gpudevice, window); - } -}; - -pub const BlendMode = u32; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pinch: PinchFingerEvent, // Pinch event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const PinchFingerEvent = extern struct { - _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_EVENT_DISPLAY_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventDisplayUsableBoundsChanged, //Display has changed usable bounds - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventScreenKeyboardShown, //The on-screen keyboard has been shown - eventScreenKeyboardHidden, //The on-screen keyboard has been hidden - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventPinchBegin = 0x710, //Pinch gesture started - eventPinchUpdate, //Pinch gesture updated - eventPinchEnd, //Pinch gesture ended - eventClipboardUpdate = 0x900, //The clipboard changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, - rsvd: bool = false, -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical = (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL), //flip horizontally and vertically (not a diagonal flip) -}; - -pub const GPUBuffer = opaque {}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Vertex = extern struct { - position: FPoint, // Vertex position, in SDL_Renderer coordinates - color: FColor, // Vertex color - tex_coord: FPoint, // Normalized texture coordinates, if needed -}; - -pub const TextureAccess = enum(c_int) { - textureaccessStatic, //Changes rarely, not lockable - textureaccessStreaming, //Changes frequently, lockable - textureaccessTarget, //Texture can be used as a render target -}; - -pub const TextureAddressMode = enum(c_int) { - textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default - textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range - textureAddressWrap, //The texture is repeated (tiled) -}; - -pub const RendererLogicalPresentation = enum(c_int) { - logicalPresentationDisabled, //There is no logical size in effect - logicalPresentationStretch, //The rendered content is stretched to the output resolution - logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color - logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds - logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution -}; - -pub const Renderer = opaque { - pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { - return c.SDL_GetGPURendererDevice(renderer); - } - - pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return c.SDL_GetRenderWindow(renderer); - } - - pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(renderer); - } - - pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(renderer); - } - - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return c.SDL_GetRenderOutputSize(renderer, @ptrCast(w), @ptrCast(h)); - } - - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return c.SDL_GetCurrentRenderOutputSize(renderer, @ptrCast(w), @ptrCast(h)); - } - - pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return c.SDL_CreateTexture(renderer, @bitCast(format), access, w, h); - } - - pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return c.SDL_CreateTextureFromSurface(renderer, surface); - } - - pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return c.SDL_CreateTextureWithProperties(renderer, props); - } - - pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return c.SDL_SetRenderTarget(renderer, texture); - } - - pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return c.SDL_GetRenderTarget(renderer); - } - - pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return c.SDL_SetRenderLogicalPresentation(renderer, w, h, mode); - } - - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return c.SDL_GetRenderLogicalPresentation(renderer, @ptrCast(w), @ptrCast(h), mode); - } - - pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return c.SDL_GetRenderLogicalPresentationRect(renderer, rect); - } - - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return c.SDL_RenderCoordinatesFromWindow(renderer, window_x, window_y, @ptrCast(x), @ptrCast(y)); - } - - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return c.SDL_RenderCoordinatesToWindow(renderer, x, y, @ptrCast(window_x), @ptrCast(window_y)); - } - - pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return c.SDL_ConvertEventToRenderCoordinates(renderer, event); - } - - pub inline fn setRenderViewport(renderer: *Renderer, rect: *const Rect) bool { - return c.SDL_SetRenderViewport(renderer, @ptrCast(rect)); - } - - pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderViewport(renderer, rect); - } - - pub inline fn renderViewportSet(renderer: *Renderer) bool { - return c.SDL_RenderViewportSet(renderer); - } - - pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderSafeArea(renderer, rect); - } - - pub inline fn setRenderClipRect(renderer: *Renderer, rect: *const Rect) bool { - return c.SDL_SetRenderClipRect(renderer, @ptrCast(rect)); - } - - pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderClipRect(renderer, rect); - } - - pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return c.SDL_RenderClipEnabled(renderer); - } - - pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return c.SDL_SetRenderScale(renderer, scaleX, scaleY); - } - - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return c.SDL_GetRenderScale(renderer, @ptrCast(scaleX), @ptrCast(scaleY)); - } - - pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return c.SDL_SetRenderDrawColor(renderer, r, g, b, a); - } - - pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_SetRenderDrawColorFloat(renderer, r, g, b, a); - } - - pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return c.SDL_GetRenderDrawColor(renderer, r, g, b, a); - } - - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return c.SDL_GetRenderDrawColorFloat(renderer, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a)); - } - - pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return c.SDL_SetRenderColorScale(renderer, scale); - } - - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return c.SDL_GetRenderColorScale(renderer, @ptrCast(scale)); - } - - pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return c.SDL_SetRenderDrawBlendMode(renderer, @intFromEnum(blendMode)); - } - - pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return c.SDL_GetRenderDrawBlendMode(renderer, @intFromEnum(blendMode)); - } - - pub inline fn renderClear(renderer: *Renderer) bool { - return c.SDL_RenderClear(renderer); - } - - pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return c.SDL_RenderPoint(renderer, x, y); - } - - pub inline fn renderPoints(renderer: *Renderer, points: *const FPoint, count: c_int) bool { - return c.SDL_RenderPoints(renderer, @ptrCast(points), count); - } - - pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return c.SDL_RenderLine(renderer, x1, y1, x2, y2); - } - - pub inline fn renderLines(renderer: *Renderer, points: *const FPoint, count: c_int) bool { - return c.SDL_RenderLines(renderer, @ptrCast(points), count); - } - - pub inline fn renderRect(renderer: *Renderer, rect: *const FRect) bool { - return c.SDL_RenderRect(renderer, @ptrCast(rect)); - } - - pub inline fn renderRects(renderer: *Renderer, rects: *const FRect, count: c_int) bool { - return c.SDL_RenderRects(renderer, @ptrCast(rects), count); - } - - pub inline fn renderFillRect(renderer: *Renderer, rect: *const FRect) bool { - return c.SDL_RenderFillRect(renderer, @ptrCast(rect)); - } - - pub inline fn renderFillRects(renderer: *Renderer, rects: *const FRect, count: c_int) bool { - return c.SDL_RenderFillRects(renderer, @ptrCast(rects), count); - } - - pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, dstrect: *const FRect) bool { - return c.SDL_RenderTexture(renderer, texture, @ptrCast(srcrect), @ptrCast(dstrect)); - } - - pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, dstrect: *const FRect, angle: f64, center: *const FPoint, flip: FlipMode) bool { - return c.SDL_RenderTextureRotated(renderer, texture, @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip)); - } - - pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, origin: *const FPoint, right: *const FPoint, down: *const FPoint) bool { - return c.SDL_RenderTextureAffine(renderer, texture, @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down)); - } - - pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, scale: f32, dstrect: *const FRect) bool { - return c.SDL_RenderTextureTiled(renderer, texture, @ptrCast(srcrect), scale, @ptrCast(dstrect)); - } - - pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: *const FRect) bool { - return c.SDL_RenderTexture9Grid(renderer, texture, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect)); - } - - pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: *const FRect, tileScale: f32) bool { - return c.SDL_RenderTexture9GridTiled(renderer, texture, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect), tileScale); - } - - pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: *const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return c.SDL_RenderGeometry(renderer, texture, @ptrCast(vertices), num_vertices, indices, num_indices); - } - - pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: *const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return c.SDL_RenderGeometryRaw(renderer, texture, @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices); - } - - pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { - return c.SDL_SetRenderTextureAddressMode(renderer, @intFromEnum(u_mode), @intFromEnum(v_mode)); - } - - pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { - return c.SDL_GetRenderTextureAddressMode(renderer, @intFromEnum(u_mode), @intFromEnum(v_mode)); - } - - pub inline fn renderReadPixels(renderer: *Renderer, rect: *const Rect) ?*Surface { - return c.SDL_RenderReadPixels(renderer, @ptrCast(rect)); - } - - pub inline fn renderPresent(renderer: *Renderer) bool { - return c.SDL_RenderPresent(renderer); - } - - pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(renderer); - } - - pub inline fn flushRenderer(renderer: *Renderer) bool { - return c.SDL_FlushRenderer(renderer); - } - - pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(renderer); - } - - pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(renderer); - } - - pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return c.SDL_AddVulkanRenderSemaphores(renderer, wait_stage_mask, wait_semaphore, signal_semaphore); - } - - pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return c.SDL_SetRenderVSync(renderer, vsync); - } - - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return c.SDL_GetRenderVSync(renderer, @ptrCast(vsync)); - } - - pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return c.SDL_RenderDebugText(renderer, x, y, str); - } - - pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { - return c.SDL_SetDefaultTextureScaleMode(renderer, @intFromEnum(scale_mode)); - } - - pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { - return c.SDL_GetDefaultTextureScaleMode(renderer, @intFromEnum(scale_mode)); - } - - pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*GPURenderStateCreateInfo) ?*GPURenderState { - return c.SDL_CreateGPURenderState(renderer, createinfo); - } - - pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { - return c.SDL_SetGPURenderState(renderer, state); - } -}; - -pub const Texture = opaque { - pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(texture); - } - - pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return c.SDL_GetRendererFromTexture(texture); - } - - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return c.SDL_GetTextureSize(texture, @ptrCast(w), @ptrCast(h)); - } - - pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { - return c.SDL_SetTexturePalette(texture, palette); - } - - pub inline fn getTexturePalette(texture: *Texture) ?*Palette { - return c.SDL_GetTexturePalette(texture); - } - - pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return c.SDL_SetTextureColorMod(texture, r, g, b); - } - - pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return c.SDL_SetTextureColorModFloat(texture, r, g, b); - } - - pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return c.SDL_GetTextureColorMod(texture, r, g, b); - } - - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return c.SDL_GetTextureColorModFloat(texture, @ptrCast(r), @ptrCast(g), @ptrCast(b)); - } - - pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return c.SDL_SetTextureAlphaMod(texture, alpha); - } - - pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return c.SDL_SetTextureAlphaModFloat(texture, alpha); - } - - pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return c.SDL_GetTextureAlphaMod(texture, alpha); - } - - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return c.SDL_GetTextureAlphaModFloat(texture, @ptrCast(alpha)); - } - - pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return c.SDL_SetTextureBlendMode(texture, @intFromEnum(blendMode)); - } - - pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return c.SDL_GetTextureBlendMode(texture, @intFromEnum(blendMode)); - } - - pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return c.SDL_SetTextureScaleMode(texture, @intFromEnum(scaleMode)); - } - - pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return c.SDL_GetTextureScaleMode(texture, @intFromEnum(scaleMode)); - } - - pub inline fn updateTexture(texture: *Texture, rect: *const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return c.SDL_UpdateTexture(texture, @ptrCast(rect), pixels, pitch); - } - - pub inline fn updateYUVTexture(texture: *Texture, rect: *const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return c.SDL_UpdateYUVTexture(texture, @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch); - } - - pub inline fn updateNVTexture(texture: *Texture, rect: *const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return c.SDL_UpdateNVTexture(texture, @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch); - } - - pub inline fn lockTexture(texture: *Texture, rect: *const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return c.SDL_LockTexture(texture, @ptrCast(rect), pixels, @ptrCast(pitch)); - } - - pub inline fn lockTextureToSurface(texture: *Texture, rect: *const Rect, surface: [*c][*c]Surface) bool { - return c.SDL_LockTextureToSurface(texture, @ptrCast(rect), surface); - } - - pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(texture); - } - - pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(texture); - } -}; - -pub inline fn getNumRenderDrivers() c_int { - return c.SDL_GetNumRenderDrivers(); -} - -pub inline fn getRenderDriver(index: c_int) [*c]const u8 { - return c.SDL_GetRenderDriver(index); -} - -pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c][*c]Window, renderer: [*c][*c]Renderer) bool { - return c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer); -} - -pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return c.SDL_CreateRendererWithProperties(props); -} - -pub const GPURenderStateCreateInfo = extern struct { - fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active - num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active - sampler_bindings: *const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active - num_storage_textures: i32, // The number of storage textures to bind when this render state is active - storage_textures: [*c]*const GPUTexture, // Storage textures to bind when this render state is active - num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active - storage_buffers: [*c]*const GPUBuffer, // Storage buffers to bind when this render state is active - props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. -}; - -pub const GPURenderState = opaque { - pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { - return c.SDL_SetGPURenderStateFragmentUniforms(gpurenderstate, slot_index, data, length); - } - - pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { - return c.SDL_DestroyGPURenderState(gpurenderstate); - } -}; diff --git a/castholm/v0.4.0-3.4.0/debug/SDL_surface_h_fmterror.zig b/castholm/v0.4.0-3.4.0/debug/SDL_surface_h_fmterror.zig deleted file mode 100644 index e802ab7..0000000 --- a/castholm/v0.4.0-3.4.0/debug/SDL_surface_h_fmterror.zig +++ /dev/null @@ -1,355 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659u, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949u, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559u, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955u, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659u, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564eu, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564eu, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050u, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454fu, //Android video texture format - pixelformatMjpg = 0x47504a4du, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadSurface_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadSurface_IO(iostream, closeio); - } - - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadBMP_IO(iostream, closeio); - } - - pub inline fn loadPNG_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadPNG_IO(iostream, closeio); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600u, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609u, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault = SDL_COLORSPACE_SRGB, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault = SDL_COLORSPACE_BT601_LIMITED, //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; - -pub const SurfaceFlags = packed struct(u32) { - surfacePreallocated: bool = false, // Surface uses preallocated pixel memory - surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels - surfaceLocked: bool = false, // Surface is currently locked - surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() - pad0: u27 = 0, - rsvd: bool = false, -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering - scalemodePixelart, -}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical = (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL), //flip horizontally and vertically (not a diagonal flip) -}; - -pub const Surface = opaque { - pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(surface); - } - - pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(surface); - } - - pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return c.SDL_SetSurfaceColorspace(surface, colorspace); - } - - pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(surface); - } - - pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return c.SDL_CreateSurfacePalette(surface); - } - - pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return c.SDL_SetSurfacePalette(surface, palette); - } - - pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return c.SDL_GetSurfacePalette(surface); - } - - pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return c.SDL_AddSurfaceAlternateImage(surface, image); - } - - pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return c.SDL_SurfaceHasAlternateImages(surface); - } - - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c][*c]Surface { - return c.SDL_GetSurfaceImages(surface, @ptrCast(count)); - } - - pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(surface); - } - - pub inline fn lockSurface(surface: *Surface) bool { - return c.SDL_LockSurface(surface); - } - - pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(surface); - } - - pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return c.SDL_SaveBMP_IO(surface, dst, closeio); - } - - pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return c.SDL_SaveBMP(surface, file); - } - - pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return c.SDL_SavePNG_IO(surface, dst, closeio); - } - - pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { - return c.SDL_SavePNG(surface, file); - } - - pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return c.SDL_SetSurfaceRLE(surface, enabled); - } - - pub inline fn surfaceHasRLE(surface: *Surface) bool { - return c.SDL_SurfaceHasRLE(surface); - } - - pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return c.SDL_SetSurfaceColorKey(surface, enabled, key); - } - - pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return c.SDL_SurfaceHasColorKey(surface); - } - - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return c.SDL_GetSurfaceColorKey(surface, @ptrCast(key)); - } - - pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return c.SDL_SetSurfaceColorMod(surface, r, g, b); - } - - pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return c.SDL_GetSurfaceColorMod(surface, r, g, b); - } - - pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return c.SDL_SetSurfaceAlphaMod(surface, alpha); - } - - pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return c.SDL_GetSurfaceAlphaMod(surface, alpha); - } - - pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return c.SDL_SetSurfaceBlendMode(surface, @intFromEnum(blendMode)); - } - - pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return c.SDL_GetSurfaceBlendMode(surface, @intFromEnum(blendMode)); - } - - pub inline fn setSurfaceClipRect(surface: *Surface, rect: *const Rect) bool { - return c.SDL_SetSurfaceClipRect(surface, @ptrCast(rect)); - } - - pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return c.SDL_GetSurfaceClipRect(surface, rect); - } - - pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return c.SDL_FlipSurface(surface, @intFromEnum(flip)); - } - - pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { - return c.SDL_RotateSurface(surface, angle); - } - - pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return c.SDL_DuplicateSurface(surface); - } - - pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return c.SDL_ScaleSurface(surface, width, height, @intFromEnum(scaleMode)); - } - - pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return c.SDL_ConvertSurface(surface, @bitCast(format)); - } - - pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return c.SDL_ConvertSurfaceAndColorspace(surface, @bitCast(format), palette, colorspace, props); - } - - pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return c.SDL_PremultiplySurfaceAlpha(surface, linear); - } - - pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_ClearSurface(surface, r, g, b, a); - } - - pub inline fn fillSurfaceRect(surface: *Surface, rect: *const Rect, color: u32) bool { - return c.SDL_FillSurfaceRect(surface, @ptrCast(rect), color); - } - - pub inline fn fillSurfaceRects(surface: *Surface, rects: *const Rect, count: c_int, color: u32) bool { - return c.SDL_FillSurfaceRects(surface, @ptrCast(rects), count, color); - } - - pub inline fn blitSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); - } - - pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceUnchecked(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); - } - - pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_BlitSurfaceScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); - } - - pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_BlitSurfaceUncheckedScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); - } - - pub inline fn stretchSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_StretchSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); - } - - pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceTiled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); - } - - pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: *const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceTiledWithScale(surface, @ptrCast(srcrect), scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect)); - } - - pub inline fn blitSurface9Grid(surface: *Surface, srcrect: *const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurface9Grid(surface, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect)); - } - - pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(surface, r, g, b); - } - - pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(surface, r, g, b, a); - } - - pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return c.SDL_ReadSurfacePixel(surface, x, y, r, g, b, a); - } - - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return c.SDL_ReadSurfacePixelFloat(surface, x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a)); - } - - pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return c.SDL_WriteSurfacePixel(surface, x, y, r, g, b, a); - } - - pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_WriteSurfacePixelFloat(surface, x, y, r, g, b, a); - } -}; - -pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return c.SDL_CreateSurface(width, height, @bitCast(format)); -} - -pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch); -} - -pub inline fn loadSurface(file: [*c]const u8) ?*Surface { - return c.SDL_LoadSurface(file); -} - -pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return c.SDL_LoadBMP(file); -} - -pub inline fn loadPNG(file: [*c]const u8) ?*Surface { - return c.SDL_LoadPNG(file); -} - -pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch); -} - -pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch); -} - -pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, linear); -} diff --git a/castholm/v0.4.0-3.4.0/debug/error_SDL_audio_h.zig b/castholm/v0.4.0-3.4.0/debug/error_SDL_audio_h.zig deleted file mode 100644 index 76ea45d..0000000 --- a/castholm/v0.4.0-3.4.0/debug/error_SDL_audio_h.zig +++ /dev/null @@ -1,269 +0,0 @@ -const std = @import("std"); -pub const c = @import("c.zig").c; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV_IO(iostream, closeio, spec, audio_buf, @ptrCast(audio_len)); - } - -}; - -pub const PropertiesID = u32; - -pub const AudioFormat = enum(c_int) { - audioUnknown = 0x0000u, //Unspecified audio format - audioU8 = 0x0008u, //Unsigned 8-bit samples - audioS8 = 0x8008u, //Signed 8-bit samples - audioS16le = 0x8010u, //Signed 16-bit samples - audioS16be = 0x9010u, //As above, but big-endian byte order - audioS32le = 0x8020u, //32-bit integer samples - audioS32be = 0x9020u, //As above, but big-endian byte order - audioF32le = 0x8120u, //32-bit floating point samples - audioF32be = 0x9120u, //As above, but big-endian byte order -}; - -pub const AudioDeviceID = u32; - -pub const AudioSpec = extern struct { - format: AudioFormat, // Audio data format - channels: c_int, // Number of channels: 1 mono, 2 stereo, etc - freq: c_int, // sample rate: sample frames per second -}; - -pub const AudioStream = opaque { - pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(audiostream); - } - - pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(audiostream); - } - - pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(audiostream); - } - - pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return c.SDL_GetAudioStreamFormat(audiostream, src_spec, dst_spec); - } - - pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: *const AudioSpec, dst_spec: *const AudioSpec) bool { - return c.SDL_SetAudioStreamFormat(audiostream, @ptrCast(src_spec), @ptrCast(dst_spec)); - } - - pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(audiostream); - } - - pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return c.SDL_SetAudioStreamFrequencyRatio(audiostream, ratio); - } - - pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(audiostream); - } - - pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return c.SDL_SetAudioStreamGain(audiostream, gain); - } - - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(audiostream, @ptrCast(count))); - } - - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(audiostream, @ptrCast(count))); - } - - pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamInputChannelMap(audiostream, chmap, count); - } - - pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamOutputChannelMap(audiostream, chmap, count); - } - - pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return c.SDL_PutAudioStreamData(audiostream, buf, len); - } - - pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { - return c.SDL_PutAudioStreamDataNoCopy(audiostream, buf, len, callback, userdata); - } - - pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const void * const, num_channels: c_int, num_samples: c_int) bool { - return c.SDL_PutAudioStreamPlanarData(audiostream, channel_buffers, num_channels, num_samples); - } - - pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(audiostream, buf, len); - } - - pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(audiostream); - } - - pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(audiostream); - } - - pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return c.SDL_FlushAudioStream(audiostream); - } - - pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return c.SDL_ClearAudioStream(audiostream); - } - - pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_PauseAudioStreamDevice(audiostream); - } - - pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_ResumeAudioStreamDevice(audiostream); - } - - pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return c.SDL_AudioStreamDevicePaused(audiostream); - } - - pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_LockAudioStream(audiostream); - } - - pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_UnlockAudioStream(audiostream); - } - - pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamGetCallback(audiostream, callback, userdata); - } - - pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamPutCallback(audiostream, callback, userdata); - } - - pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(audiostream); - } - -}; - -pub inline fn getNumAudioDrivers() c_int { - return c.SDL_GetNumAudioDrivers(); -} - -pub inline fn getAudioDriver(index: c_int) [*c]const u8 { - return c.SDL_GetAudioDriver(index); -} - -pub inline fn getCurrentAudioDriver() [*c]const u8 { - return c.SDL_GetCurrentAudioDriver(); -} - -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioPlaybackDevices(@ptrCast(count)); -} - -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioRecordingDevices(@ptrCast(count)); -} - -pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { - return c.SDL_GetAudioDeviceName(devid); -} - -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return c.SDL_GetAudioDeviceFormat(devid, spec, @ptrCast(sample_frames)); -} - -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); -} - -pub inline fn openAudioDevice(devid: AudioDeviceID, spec: *const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); -} - -pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePhysical(devid); -} - -pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePlayback(devid); -} - -pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_PauseAudioDevice(devid); -} - -pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_ResumeAudioDevice(devid); -} - -pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { - return c.SDL_AudioDevicePaused(devid); -} - -pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { - return c.SDL_GetAudioDeviceGain(devid); -} - -pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { - return c.SDL_SetAudioDeviceGain(devid, gain); -} - -pub inline fn closeAudioDevice(devid: AudioDeviceID) void { - return c.SDL_CloseAudioDevice(devid); -} - -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]*const AudioStream, num_streams: c_int) bool { - return c.SDL_BindAudioStreams(devid, streams, num_streams); -} - -pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return c.SDL_BindAudioStream(devid, stream); -} - -pub inline fn unbindAudioStreams(streams: [*c]*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); -} - -pub inline fn createAudioStream(src_spec: *const AudioSpec, dst_spec: *const AudioSpec) ?*AudioStream { - return c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec)); -} - -pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; - -pub const AudioStreamCallback = c.SDL_AudioStreamCallback; - -pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: *const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata); -} - -pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; - -pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioPostmixCallback(devid, callback, userdata); -} - -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV(path, spec, audio_buf, @ptrCast(audio_len)); -} - -pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return c.SDL_MixAudio(dst, src, @bitCast(format), len, volume); -} - -pub inline fn convertAudioSamples(src_spec: *const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: *const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len)); -} - -pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); -} - -pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); -} - diff --git a/castholm/v0.4.0-3.4.0/json/audio.json b/castholm/v0.4.0-3.4.0/json/audio.json index 8789458..49dec69 100644 --- a/castholm/v0.4.0-3.4.0/json/audio.json +++ b/castholm/v0.4.0-3.4.0/json/audio.json @@ -71,6 +71,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/castholm/v0.4.0-3.4.0/json/blendmode.json b/castholm/v0.4.0-3.4.0/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/castholm/v0.4.0-3.4.0/json/blendmode.json +++ b/castholm/v0.4.0-3.4.0/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/castholm/v0.4.0-3.4.0/json/camera.json b/castholm/v0.4.0-3.4.0/json/camera.json index 14b234f..1405b5e 100644 --- a/castholm/v0.4.0-3.4.0/json/camera.json +++ b/castholm/v0.4.0-3.4.0/json/camera.json @@ -31,6 +31,10 @@ { "name": "SDL_CameraPermissionState", "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, { "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" }, diff --git a/castholm/v0.4.0-3.4.0/json/events.json b/castholm/v0.4.0-3.4.0/json/events.json index a2aad31..f7c6aa7 100644 --- a/castholm/v0.4.0-3.4.0/json/events.json +++ b/castholm/v0.4.0-3.4.0/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -81,6 +87,14 @@ "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", "comment": "Display has changed usable bounds" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -91,7 +105,8 @@ "comment": "Window has been hidden" }, { - "name": "SDL_EVENT_WINDOW_EXPOSED" + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." }, { "name": "SDL_EVENT_WINDOW_MOVED", @@ -174,12 +189,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -198,7 +222,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -331,6 +356,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -460,6 +489,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -473,6 +506,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1117,6 +1162,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/castholm/v0.4.0-3.4.0/json/filesystem.json b/castholm/v0.4.0-3.4.0/json/filesystem.json index 25d3c30..37e102f 100644 --- a/castholm/v0.4.0-3.4.0/json/filesystem.json +++ b/castholm/v0.4.0-3.4.0/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/castholm/v0.4.0-3.4.0/json/gamepad.json b/castholm/v0.4.0-3.4.0/json/gamepad.json index a3acc3a..7ffbe51 100644 --- a/castholm/v0.4.0-3.4.0/json/gamepad.json +++ b/castholm/v0.4.0-3.4.0/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -53,6 +57,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -186,6 +194,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -212,6 +224,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/castholm/v0.4.0-3.4.0/json/gpu.json b/castholm/v0.4.0-3.4.0/json/gpu.json index 7368c6b..514880a 100644 --- a/castholm/v0.4.0-3.4.0/json/gpu.json +++ b/castholm/v0.4.0-3.4.0/json/gpu.json @@ -41,12 +41,7 @@ "name": "SDL_GPUFence" } ], - "typedefs": [ - { - "name": "SDL_GPUShaderFormat", - "underlying_type": "Uint32" - } - ], + "typedefs": [], "function_pointers": [], "c_type_aliases": [], "enums": [ @@ -794,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -853,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, @@ -2338,6 +2335,42 @@ } ] }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, { "name": "SDL_GPUColorComponentFlags", "underlying_type": "Uint8", diff --git a/castholm/v0.4.0-3.4.0/json/guid.json b/castholm/v0.4.0-3.4.0/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/haptic.json b/castholm/v0.4.0-3.4.0/json/haptic.json index 55640bf..83227a3 100644 --- a/castholm/v0.4.0-3.4.0/json/haptic.json +++ b/castholm/v0.4.0-3.4.0/json/haptic.json @@ -105,6 +105,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -175,6 +179,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/castholm/v0.4.0-3.4.0/json/init.json b/castholm/v0.4.0-3.4.0/json/init.json index 83fecb9..d315e0e 100644 --- a/castholm/v0.4.0-3.4.0/json/init.json +++ b/castholm/v0.4.0-3.4.0/json/init.json @@ -48,40 +48,40 @@ "values": [ { "name": "SDL_INIT_AUDIO", - "value": "0x00000010u", + "value": "(1u << 4)", "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_VIDEO", - "value": "0x00000020u", + "value": "(1u << 5)", "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" }, { "name": "SDL_INIT_JOYSTICK", - "value": "0x00000200u", + "value": "(1u << 9)", "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_HAPTIC", - "value": "0x00001000u" + "value": "(1u << 12)" }, { "name": "SDL_INIT_GAMEPAD", - "value": "0x00002000u", + "value": "(1u << 13)", "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" }, { "name": "SDL_INIT_EVENTS", - "value": "0x00004000u" + "value": "(1u << 14)" }, { "name": "SDL_INIT_SENSOR", - "value": "0x00008000u", + "value": "(1u << 15)", "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_CAMERA", - "value": "0x00010000u", + "value": "(1u << 16)", "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" } ] diff --git a/castholm/v0.4.0-3.4.0/json/iostream.json b/castholm/v0.4.0-3.4.0/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/joystick.json b/castholm/v0.4.0-3.4.0/json/joystick.json index 4987f44..a9aa729 100644 --- a/castholm/v0.4.0-3.4.0/json/joystick.json +++ b/castholm/v0.4.0-3.4.0/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/castholm/v0.4.0-3.4.0/json/keyboard.json b/castholm/v0.4.0-3.4.0/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/messagebox.json b/castholm/v0.4.0-3.4.0/json/messagebox.json index 3d417d3..d9ab053 100644 --- a/castholm/v0.4.0-3.4.0/json/messagebox.json +++ b/castholm/v0.4.0-3.4.0/json/messagebox.json @@ -122,27 +122,27 @@ "values": [ { "name": "SDL_MESSAGEBOX_ERROR", - "value": "0x00000010u", + "value": "(1u << 4)", "comment": "error dialog" }, { "name": "SDL_MESSAGEBOX_WARNING", - "value": "0x00000020u", + "value": "(1u << 5)", "comment": "warning dialog" }, { "name": "SDL_MESSAGEBOX_INFORMATION", - "value": "0x00000040u", + "value": "(1u << 6)", "comment": "informational dialog" }, { "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", - "value": "0x00000080u", + "value": "(1u << 7)", "comment": "buttons placed left to right" }, { "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", - "value": "0x00000100u", + "value": "(1u << 8)", "comment": "buttons placed right to left" } ] @@ -153,12 +153,12 @@ "values": [ { "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", - "value": "0x00000001u", + "value": "(1u << 0)", "comment": "Marks the default button when return is hit" }, { "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", - "value": "0x00000002u", + "value": "(1u << 1)", "comment": "Marks the default button when escape is hit" } ] diff --git a/castholm/v0.4.0-3.4.0/json/mouse.json b/castholm/v0.4.0-3.4.0/json/mouse.json index 72cd405..b8bbf8b 100644 --- a/castholm/v0.4.0-3.4.0/json/mouse.json +++ b/castholm/v0.4.0-3.4.0/json/mouse.json @@ -145,23 +145,15 @@ "values": [ { "name": "SDL_BUTTON_LEFT", - "value": "1" + "value": "(1u << 0)" }, { "name": "SDL_BUTTON_MIDDLE", - "value": "2" - }, - { - "name": "SDL_BUTTON_RIGHT", - "value": "3" + "value": "(1u << 1)" }, { "name": "SDL_BUTTON_X1", - "value": "4" - }, - { - "name": "SDL_BUTTON_X2", - "value": "5" + "value": "(1u << 2)" } ] } diff --git a/castholm/v0.4.0-3.4.0/json/opengl.json b/castholm/v0.4.0-3.4.0/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/pen.json b/castholm/v0.4.0-3.4.0/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/pixels.json b/castholm/v0.4.0-3.4.0/json/pixels.json index b7b9489..b5e344c 100644 --- a/castholm/v0.4.0-3.4.0/json/pixels.json +++ b/castholm/v0.4.0-3.4.0/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/castholm/v0.4.0-3.4.0/json/power.json b/castholm/v0.4.0-3.4.0/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/process.json b/castholm/v0.4.0-3.4.0/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/render.json b/castholm/v0.4.0-3.4.0/json/render.json index bccb3fb..8c28849 100644 --- a/castholm/v0.4.0-3.4.0/json/render.json +++ b/castholm/v0.4.0-3.4.0/json/render.json @@ -35,6 +35,10 @@ { "name": "SDL_TextureAddressMode", "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, { "name": "SDL_TEXTURE_ADDRESS_AUTO", "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" diff --git a/castholm/v0.4.0-3.4.0/json/scancode.json b/castholm/v0.4.0-3.4.0/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/surface.json b/castholm/v0.4.0-3.4.0/json/surface.json index 252efe7..af6fa27 100644 --- a/castholm/v0.4.0-3.4.0/json/surface.json +++ b/castholm/v0.4.0-3.4.0/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" @@ -21,7 +25,8 @@ "comment": "linear filtering" }, { - "name": "SDL_SCALEMODE_PIXELART" + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" } ] }, @@ -57,22 +62,22 @@ "values": [ { "name": "SDL_SURFACE_PREALLOCATED", - "value": "0x00000001u", + "value": "(1u << 0)", "comment": "Surface uses preallocated pixel memory" }, { "name": "SDL_SURFACE_LOCK_NEEDED", - "value": "0x00000002u", + "value": "(1u << 1)", "comment": "Surface needs to be locked to access pixels" }, { "name": "SDL_SURFACE_LOCKED", - "value": "0x00000004u", + "value": "(1u << 2)", "comment": "Surface is currently locked" }, { "name": "SDL_SURFACE_SIMD_ALIGNED", - "value": "0x00000008u", + "value": "(1u << 3)", "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" } ] diff --git a/castholm/v0.4.0-3.4.0/json/system.json b/castholm/v0.4.0-3.4.0/json/system.json index a598bb0..4201c5a 100644 --- a/castholm/v0.4.0-3.4.0/json/system.json +++ b/castholm/v0.4.0-3.4.0/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/castholm/v0.4.0-3.4.0/json/touch.json b/castholm/v0.4.0-3.4.0/json/touch.json index 90dc4bc..fc5caab 100644 --- a/castholm/v0.4.0-3.4.0/json/touch.json +++ b/castholm/v0.4.0-3.4.0/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/castholm/v0.4.0-3.4.0/json/tray.json b/castholm/v0.4.0-3.4.0/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.4.0-3.4.0/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.0-3.4.0/json/video.json b/castholm/v0.4.0-3.4.0/json/video.json index cef2a5b..cb4c11e 100644 --- a/castholm/v0.4.0-3.4.0/json/video.json +++ b/castholm/v0.4.0-3.4.0/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, @@ -379,132 +380,132 @@ "values": [ { "name": "SDL_WINDOW_FULLSCREEN", - "value": "SDL_UINT64_C(0x0000000000000001)", + "value": "(1u << 0)", "comment": "window is in fullscreen mode" }, { "name": "SDL_WINDOW_OPENGL", - "value": "SDL_UINT64_C(0x0000000000000002)", + "value": "(1u << 1)", "comment": "window usable with OpenGL context" }, { "name": "SDL_WINDOW_OCCLUDED", - "value": "SDL_UINT64_C(0x0000000000000004)", + "value": "(1u << 2)", "comment": "window is occluded" }, { "name": "SDL_WINDOW_HIDDEN", - "value": "SDL_UINT64_C(0x0000000000000008)", + "value": "(1u << 3)", "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" }, { "name": "SDL_WINDOW_BORDERLESS", - "value": "SDL_UINT64_C(0x0000000000000010)", + "value": "(1u << 4)", "comment": "no window decoration" }, { "name": "SDL_WINDOW_RESIZABLE", - "value": "SDL_UINT64_C(0x0000000000000020)", + "value": "(1u << 5)", "comment": "window can be resized" }, { "name": "SDL_WINDOW_MINIMIZED", - "value": "SDL_UINT64_C(0x0000000000000040)", + "value": "(1u << 6)", "comment": "window is minimized" }, { "name": "SDL_WINDOW_MAXIMIZED", - "value": "SDL_UINT64_C(0x0000000000000080)", + "value": "(1u << 7)", "comment": "window is maximized" }, { "name": "SDL_WINDOW_MOUSE_GRABBED", - "value": "SDL_UINT64_C(0x0000000000000100)", + "value": "(1u << 8)", "comment": "window has grabbed mouse input" }, { "name": "SDL_WINDOW_INPUT_FOCUS", - "value": "SDL_UINT64_C(0x0000000000000200)", + "value": "(1u << 9)", "comment": "window has input focus" }, { "name": "SDL_WINDOW_MOUSE_FOCUS", - "value": "SDL_UINT64_C(0x0000000000000400)", + "value": "(1u << 10)", "comment": "window has mouse focus" }, { "name": "SDL_WINDOW_EXTERNAL", - "value": "SDL_UINT64_C(0x0000000000000800)", + "value": "(1u << 11)", "comment": "window not created by SDL" }, { "name": "SDL_WINDOW_MODAL", - "value": "SDL_UINT64_C(0x0000000000001000)", + "value": "(1u << 12)", "comment": "window is modal" }, { "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", - "value": "SDL_UINT64_C(0x0000000000002000)", + "value": "(1u << 13)", "comment": "window uses high pixel density back buffer if possible" }, { "name": "SDL_WINDOW_MOUSE_CAPTURE", - "value": "SDL_UINT64_C(0x0000000000004000)", + "value": "(1u << 14)", "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" }, { "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", - "value": "SDL_UINT64_C(0x0000000000008000)", + "value": "(1u << 15)", "comment": "window has relative mode enabled" }, { "name": "SDL_WINDOW_ALWAYS_ON_TOP", - "value": "SDL_UINT64_C(0x0000000000010000)", + "value": "(1u << 16)", "comment": "window should always be above others" }, { "name": "SDL_WINDOW_UTILITY", - "value": "SDL_UINT64_C(0x0000000000020000)", + "value": "(1u << 17)", "comment": "window should be treated as a utility window, not showing in the task bar and window list" }, { "name": "SDL_WINDOW_TOOLTIP", - "value": "SDL_UINT64_C(0x0000000000040000)", + "value": "(1u << 18)", "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" }, { "name": "SDL_WINDOW_POPUP_MENU", - "value": "SDL_UINT64_C(0x0000000000080000)", + "value": "(1u << 19)", "comment": "window should be treated as a popup menu, requires a parent window" }, { "name": "SDL_WINDOW_KEYBOARD_GRABBED", - "value": "SDL_UINT64_C(0x0000000000100000)", + "value": "(1u << 20)", "comment": "window has grabbed keyboard input" }, { "name": "SDL_WINDOW_FILL_DOCUMENT", - "value": "SDL_UINT64_C(0x0000000000200000)", + "value": "(1u << 21)", "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" }, { "name": "SDL_WINDOW_VULKAN", - "value": "SDL_UINT64_C(0x0000000010000000)", + "value": "(1u << 28)", "comment": "window usable for Vulkan surface" }, { "name": "SDL_WINDOW_METAL", - "value": "SDL_UINT64_C(0x0000000020000000)", + "value": "(1u << 29)", "comment": "window usable for Metal view" }, { "name": "SDL_WINDOW_TRANSPARENT", - "value": "SDL_UINT64_C(0x0000000040000000)", + "value": "(1u << 30)", "comment": "window with transparent buffer" }, { "name": "SDL_WINDOW_NOT_FOCUSABLE", - "value": "SDL_UINT64_C(0x0000000080000000)", + "value": "(1u << 31)", "comment": "window should not be focusable" } ] diff --git a/official/release-3.2.0/api/audio.zig b/official/release-3.2.0/api/audio.zig index 3564f87..293bbd0 100644 --- a/official/release-3.2.0/api/audio.zig +++ b/official/release-3.2.0/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.0/api/blendmode.zig b/official/release-3.2.0/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.0/api/blendmode.zig +++ b/official/release-3.2.0/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.0/api/c.zig b/official/release-3.2.0/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.0/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.0/api/camera.zig b/official/release-3.2.0/api/camera.zig index bb1e756..095f7e6 100644 --- a/official/release-3.2.0/api/camera.zig +++ b/official/release-3.2.0/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(devid, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.0/api/clipboard.zig b/official/release-3.2.0/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.0/api/clipboard.zig +++ b/official/release-3.2.0/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.0/api/dialog.zig b/official/release-3.2.0/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.0/api/dialog.zig +++ b/official/release-3.2.0/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.0/api/error.zig b/official/release-3.2.0/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.0/api/error.zig +++ b/official/release-3.2.0/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.0/api/events.zig b/official/release-3.2.0/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.0/api/events.zig +++ b/official/release-3.2.0/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.0/api/filesystem.zig b/official/release-3.2.0/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.0/api/filesystem.zig +++ b/official/release-3.2.0/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.0/api/gamepad.zig b/official/release-3.2.0/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.0/api/gamepad.zig +++ b/official/release-3.2.0/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.0/api/gpu.zig b/official/release-3.2.0/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/official/release-3.2.0/api/gpu.zig +++ b/official/release-3.2.0/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.0/api/guid.zig b/official/release-3.2.0/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.0/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.0/api/haptic.zig b/official/release-3.2.0/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.0/api/haptic.zig +++ b/official/release-3.2.0/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.0/api/hints.zig b/official/release-3.2.0/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.0/api/hints.zig +++ b/official/release-3.2.0/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.0/api/init.zig b/official/release-3.2.0/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.0/api/init.zig +++ b/official/release-3.2.0/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.0/api/iostream.zig b/official/release-3.2.0/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.0/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.0/api/joystick.zig b/official/release-3.2.0/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.0/api/joystick.zig +++ b/official/release-3.2.0/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.0/api/keyboard.zig b/official/release-3.2.0/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.0/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.0/api/keycode.zig b/official/release-3.2.0/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.0/api/keycode.zig +++ b/official/release-3.2.0/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.0/api/loadso.zig b/official/release-3.2.0/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.0/api/loadso.zig +++ b/official/release-3.2.0/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.0/api/messagebox.zig b/official/release-3.2.0/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.0/api/messagebox.zig +++ b/official/release-3.2.0/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.0/api/misc.zig b/official/release-3.2.0/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.0/api/misc.zig +++ b/official/release-3.2.0/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.0/api/mouse.zig b/official/release-3.2.0/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.0/api/mouse.zig +++ b/official/release-3.2.0/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.0/api/opengl.zig b/official/release-3.2.0/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.0/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.0/api/pen.zig b/official/release-3.2.0/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.0/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.0/api/pixels.zig b/official/release-3.2.0/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/official/release-3.2.0/api/pixels.zig +++ b/official/release-3.2.0/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.0/api/power.zig b/official/release-3.2.0/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.0/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.0/api/process.zig b/official/release-3.2.0/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.0/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.0/api/properties.zig b/official/release-3.2.0/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.0/api/properties.zig +++ b/official/release-3.2.0/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.0/api/rect.zig b/official/release-3.2.0/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.0/api/rect.zig +++ b/official/release-3.2.0/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.0/api/render.zig b/official/release-3.2.0/api/render.zig index aaad785..0c57be7 100644 --- a/official/release-3.2.0/api/render.zig +++ b/official/release-3.2.0/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.0/api/scancode.zig b/official/release-3.2.0/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.0/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.0/api/sensor.zig b/official/release-3.2.0/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.0/api/sensor.zig +++ b/official/release-3.2.0/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.0/api/stdinc.zig b/official/release-3.2.0/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.0/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.0/api/storage.zig b/official/release-3.2.0/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.0/api/storage.zig +++ b/official/release-3.2.0/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.0/api/surface.zig b/official/release-3.2.0/api/surface.zig index 64a300e..22787cd 100644 --- a/official/release-3.2.0/api/surface.zig +++ b/official/release-3.2.0/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.0/api/system.zig b/official/release-3.2.0/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.0/api/system.zig +++ b/official/release-3.2.0/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.0/api/time.zig b/official/release-3.2.0/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.0/api/time.zig +++ b/official/release-3.2.0/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.0/api/timer.zig b/official/release-3.2.0/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.0/api/timer.zig +++ b/official/release-3.2.0/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.0/api/touch.zig b/official/release-3.2.0/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.0/api/touch.zig +++ b/official/release-3.2.0/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.0/api/tray.zig b/official/release-3.2.0/api/tray.zig new file mode 100644 index 0000000..2d6248a --- /dev/null +++ b/official/release-3.2.0/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.0/api/version.zig b/official/release-3.2.0/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.0/api/version.zig +++ b/official/release-3.2.0/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.0/api/video.zig b/official/release-3.2.0/api/video.zig index 9125b0e..e43f76c 100644 --- a/official/release-3.2.0/api/video.zig +++ b/official/release-3.2.0/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.0/json/audio.json b/official/release-3.2.0/json/audio.json index 2f74550..1a12cf4 100644 --- a/official/release-3.2.0/json/audio.json +++ b/official/release-3.2.0/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.0/json/blendmode.json b/official/release-3.2.0/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.0/json/blendmode.json +++ b/official/release-3.2.0/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.0/json/events.json b/official/release-3.2.0/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.0/json/events.json +++ b/official/release-3.2.0/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.0/json/filesystem.json b/official/release-3.2.0/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.0/json/filesystem.json +++ b/official/release-3.2.0/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.0/json/gamepad.json b/official/release-3.2.0/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.0/json/gamepad.json +++ b/official/release-3.2.0/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.0/json/gpu.json b/official/release-3.2.0/json/gpu.json index b1de6d6..a63962c 100644 --- a/official/release-3.2.0/json/gpu.json +++ b/official/release-3.2.0/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.0/json/guid.json b/official/release-3.2.0/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.0/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/haptic.json b/official/release-3.2.0/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.0/json/haptic.json +++ b/official/release-3.2.0/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.0/json/iostream.json b/official/release-3.2.0/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.0/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/joystick.json b/official/release-3.2.0/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.0/json/joystick.json +++ b/official/release-3.2.0/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.0/json/keyboard.json b/official/release-3.2.0/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.0/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/opengl.json b/official/release-3.2.0/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.0/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/pen.json b/official/release-3.2.0/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.0/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/pixels.json b/official/release-3.2.0/json/pixels.json index 3767023..da971fa 100644 --- a/official/release-3.2.0/json/pixels.json +++ b/official/release-3.2.0/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.0/json/power.json b/official/release-3.2.0/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.0/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/process.json b/official/release-3.2.0/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.0/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/scancode.json b/official/release-3.2.0/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.0/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/system.json b/official/release-3.2.0/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.0/json/system.json +++ b/official/release-3.2.0/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.0/json/touch.json b/official/release-3.2.0/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.0/json/touch.json +++ b/official/release-3.2.0/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.0/json/tray.json b/official/release-3.2.0/json/tray.json new file mode 100644 index 0000000..949e5a5 --- /dev/null +++ b/official/release-3.2.0/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.0/json/video.json b/official/release-3.2.0/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.0/json/video.json +++ b/official/release-3.2.0/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.10/api/audio.zig b/official/release-3.2.10/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.10/api/audio.zig +++ b/official/release-3.2.10/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.10/api/blendmode.zig b/official/release-3.2.10/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.10/api/blendmode.zig +++ b/official/release-3.2.10/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.10/api/c.zig b/official/release-3.2.10/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.10/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.10/api/camera.zig b/official/release-3.2.10/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.10/api/camera.zig +++ b/official/release-3.2.10/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.10/api/clipboard.zig b/official/release-3.2.10/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.10/api/clipboard.zig +++ b/official/release-3.2.10/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.10/api/dialog.zig b/official/release-3.2.10/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.10/api/dialog.zig +++ b/official/release-3.2.10/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.10/api/error.zig b/official/release-3.2.10/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.10/api/error.zig +++ b/official/release-3.2.10/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.10/api/events.zig b/official/release-3.2.10/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.10/api/events.zig +++ b/official/release-3.2.10/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.10/api/filesystem.zig b/official/release-3.2.10/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.10/api/filesystem.zig +++ b/official/release-3.2.10/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.10/api/gamepad.zig b/official/release-3.2.10/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.10/api/gamepad.zig +++ b/official/release-3.2.10/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.10/api/gpu.zig b/official/release-3.2.10/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.10/api/gpu.zig +++ b/official/release-3.2.10/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.10/api/guid.zig b/official/release-3.2.10/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.10/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.10/api/haptic.zig b/official/release-3.2.10/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.10/api/haptic.zig +++ b/official/release-3.2.10/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.10/api/hints.zig b/official/release-3.2.10/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.10/api/hints.zig +++ b/official/release-3.2.10/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.10/api/init.zig b/official/release-3.2.10/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.10/api/init.zig +++ b/official/release-3.2.10/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.10/api/iostream.zig b/official/release-3.2.10/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.10/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.10/api/joystick.zig b/official/release-3.2.10/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.10/api/joystick.zig +++ b/official/release-3.2.10/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.10/api/keyboard.zig b/official/release-3.2.10/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.10/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.10/api/keycode.zig b/official/release-3.2.10/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.10/api/keycode.zig +++ b/official/release-3.2.10/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.10/api/loadso.zig b/official/release-3.2.10/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.10/api/loadso.zig +++ b/official/release-3.2.10/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.10/api/messagebox.zig b/official/release-3.2.10/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.10/api/messagebox.zig +++ b/official/release-3.2.10/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.10/api/misc.zig b/official/release-3.2.10/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.10/api/misc.zig +++ b/official/release-3.2.10/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.10/api/mouse.zig b/official/release-3.2.10/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.10/api/mouse.zig +++ b/official/release-3.2.10/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.10/api/opengl.zig b/official/release-3.2.10/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.10/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.10/api/pen.zig b/official/release-3.2.10/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.10/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.10/api/pixels.zig b/official/release-3.2.10/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.10/api/pixels.zig +++ b/official/release-3.2.10/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.10/api/power.zig b/official/release-3.2.10/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.10/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.10/api/process.zig b/official/release-3.2.10/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.10/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.10/api/properties.zig b/official/release-3.2.10/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.10/api/properties.zig +++ b/official/release-3.2.10/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.10/api/rect.zig b/official/release-3.2.10/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.10/api/rect.zig +++ b/official/release-3.2.10/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.10/api/render.zig b/official/release-3.2.10/api/render.zig index 13eefa3..0c57be7 100644 --- a/official/release-3.2.10/api/render.zig +++ b/official/release-3.2.10/api/render.zig @@ -1,792 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -811,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1146,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.10/api/scancode.zig b/official/release-3.2.10/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.10/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.10/api/sensor.zig b/official/release-3.2.10/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.10/api/sensor.zig +++ b/official/release-3.2.10/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.10/api/stdinc.zig b/official/release-3.2.10/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.10/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.10/api/storage.zig b/official/release-3.2.10/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.10/api/storage.zig +++ b/official/release-3.2.10/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.10/api/surface.zig b/official/release-3.2.10/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.10/api/surface.zig +++ b/official/release-3.2.10/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.10/api/system.zig b/official/release-3.2.10/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.10/api/system.zig +++ b/official/release-3.2.10/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.10/api/time.zig b/official/release-3.2.10/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.10/api/time.zig +++ b/official/release-3.2.10/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.10/api/timer.zig b/official/release-3.2.10/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.10/api/timer.zig +++ b/official/release-3.2.10/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.10/api/touch.zig b/official/release-3.2.10/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.10/api/touch.zig +++ b/official/release-3.2.10/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.10/api/tray.zig b/official/release-3.2.10/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.10/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.10/api/version.zig b/official/release-3.2.10/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.10/api/version.zig +++ b/official/release-3.2.10/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.10/api/video.zig b/official/release-3.2.10/api/video.zig index 9fa1e06..e43f76c 100644 --- a/official/release-3.2.10/api/video.zig +++ b/official/release-3.2.10/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.10/json/audio.json b/official/release-3.2.10/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.10/json/audio.json +++ b/official/release-3.2.10/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.10/json/blendmode.json b/official/release-3.2.10/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.10/json/blendmode.json +++ b/official/release-3.2.10/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.10/json/events.json b/official/release-3.2.10/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.10/json/events.json +++ b/official/release-3.2.10/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.10/json/filesystem.json b/official/release-3.2.10/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.10/json/filesystem.json +++ b/official/release-3.2.10/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.10/json/gamepad.json b/official/release-3.2.10/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.10/json/gamepad.json +++ b/official/release-3.2.10/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.10/json/gpu.json b/official/release-3.2.10/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.10/json/gpu.json +++ b/official/release-3.2.10/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.10/json/guid.json b/official/release-3.2.10/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.10/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/haptic.json b/official/release-3.2.10/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.10/json/haptic.json +++ b/official/release-3.2.10/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.10/json/iostream.json b/official/release-3.2.10/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.10/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/joystick.json b/official/release-3.2.10/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.10/json/joystick.json +++ b/official/release-3.2.10/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.10/json/keyboard.json b/official/release-3.2.10/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.10/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/opengl.json b/official/release-3.2.10/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.10/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/pen.json b/official/release-3.2.10/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.10/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/pixels.json b/official/release-3.2.10/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.10/json/pixels.json +++ b/official/release-3.2.10/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.10/json/power.json b/official/release-3.2.10/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.10/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/process.json b/official/release-3.2.10/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.10/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/scancode.json b/official/release-3.2.10/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.10/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/surface.json b/official/release-3.2.10/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.10/json/surface.json +++ b/official/release-3.2.10/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.10/json/system.json b/official/release-3.2.10/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.10/json/system.json +++ b/official/release-3.2.10/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.10/json/touch.json b/official/release-3.2.10/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.10/json/touch.json +++ b/official/release-3.2.10/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.10/json/tray.json b/official/release-3.2.10/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.10/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.10/json/video.json b/official/release-3.2.10/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.10/json/video.json +++ b/official/release-3.2.10/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.12/api/audio.zig b/official/release-3.2.12/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.12/api/audio.zig +++ b/official/release-3.2.12/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.12/api/blendmode.zig b/official/release-3.2.12/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.12/api/blendmode.zig +++ b/official/release-3.2.12/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.12/api/c.zig b/official/release-3.2.12/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.12/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.12/api/camera.zig b/official/release-3.2.12/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.12/api/camera.zig +++ b/official/release-3.2.12/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.12/api/clipboard.zig b/official/release-3.2.12/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.12/api/clipboard.zig +++ b/official/release-3.2.12/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.12/api/dialog.zig b/official/release-3.2.12/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.12/api/dialog.zig +++ b/official/release-3.2.12/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.12/api/error.zig b/official/release-3.2.12/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.12/api/error.zig +++ b/official/release-3.2.12/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.12/api/events.zig b/official/release-3.2.12/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.12/api/events.zig +++ b/official/release-3.2.12/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.12/api/filesystem.zig b/official/release-3.2.12/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.12/api/filesystem.zig +++ b/official/release-3.2.12/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.12/api/gamepad.zig b/official/release-3.2.12/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.12/api/gamepad.zig +++ b/official/release-3.2.12/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.12/api/gpu.zig b/official/release-3.2.12/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.12/api/gpu.zig +++ b/official/release-3.2.12/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.12/api/guid.zig b/official/release-3.2.12/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.12/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.12/api/haptic.zig b/official/release-3.2.12/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.12/api/haptic.zig +++ b/official/release-3.2.12/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.12/api/hints.zig b/official/release-3.2.12/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.12/api/hints.zig +++ b/official/release-3.2.12/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.12/api/init.zig b/official/release-3.2.12/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.12/api/init.zig +++ b/official/release-3.2.12/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.12/api/iostream.zig b/official/release-3.2.12/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.12/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.12/api/joystick.zig b/official/release-3.2.12/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.12/api/joystick.zig +++ b/official/release-3.2.12/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.12/api/keyboard.zig b/official/release-3.2.12/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.12/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.12/api/keycode.zig b/official/release-3.2.12/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.12/api/keycode.zig +++ b/official/release-3.2.12/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.12/api/loadso.zig b/official/release-3.2.12/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.12/api/loadso.zig +++ b/official/release-3.2.12/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.12/api/messagebox.zig b/official/release-3.2.12/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.12/api/messagebox.zig +++ b/official/release-3.2.12/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.12/api/misc.zig b/official/release-3.2.12/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.12/api/misc.zig +++ b/official/release-3.2.12/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.12/api/mouse.zig b/official/release-3.2.12/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.12/api/mouse.zig +++ b/official/release-3.2.12/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.12/api/opengl.zig b/official/release-3.2.12/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.12/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.12/api/pen.zig b/official/release-3.2.12/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.12/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.12/api/pixels.zig b/official/release-3.2.12/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.12/api/pixels.zig +++ b/official/release-3.2.12/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.12/api/power.zig b/official/release-3.2.12/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.12/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.12/api/process.zig b/official/release-3.2.12/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.12/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.12/api/properties.zig b/official/release-3.2.12/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.12/api/properties.zig +++ b/official/release-3.2.12/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.12/api/rect.zig b/official/release-3.2.12/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.12/api/rect.zig +++ b/official/release-3.2.12/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.12/api/render.zig b/official/release-3.2.12/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.12/api/render.zig +++ b/official/release-3.2.12/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.12/api/scancode.zig b/official/release-3.2.12/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.12/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.12/api/sensor.zig b/official/release-3.2.12/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.12/api/sensor.zig +++ b/official/release-3.2.12/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.12/api/stdinc.zig b/official/release-3.2.12/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.12/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.12/api/storage.zig b/official/release-3.2.12/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.12/api/storage.zig +++ b/official/release-3.2.12/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.12/api/surface.zig b/official/release-3.2.12/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.12/api/surface.zig +++ b/official/release-3.2.12/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.12/api/system.zig b/official/release-3.2.12/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.12/api/system.zig +++ b/official/release-3.2.12/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.12/api/time.zig b/official/release-3.2.12/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.12/api/time.zig +++ b/official/release-3.2.12/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.12/api/timer.zig b/official/release-3.2.12/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.12/api/timer.zig +++ b/official/release-3.2.12/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.12/api/touch.zig b/official/release-3.2.12/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.12/api/touch.zig +++ b/official/release-3.2.12/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.12/api/tray.zig b/official/release-3.2.12/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.12/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.12/api/version.zig b/official/release-3.2.12/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.12/api/version.zig +++ b/official/release-3.2.12/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.12/api/video.zig b/official/release-3.2.12/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.12/api/video.zig +++ b/official/release-3.2.12/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.12/json/audio.json b/official/release-3.2.12/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.12/json/audio.json +++ b/official/release-3.2.12/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.12/json/blendmode.json b/official/release-3.2.12/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.12/json/blendmode.json +++ b/official/release-3.2.12/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.12/json/events.json b/official/release-3.2.12/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.12/json/events.json +++ b/official/release-3.2.12/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.12/json/filesystem.json b/official/release-3.2.12/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.12/json/filesystem.json +++ b/official/release-3.2.12/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.12/json/gamepad.json b/official/release-3.2.12/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.12/json/gamepad.json +++ b/official/release-3.2.12/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.12/json/gpu.json b/official/release-3.2.12/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.12/json/gpu.json +++ b/official/release-3.2.12/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.12/json/guid.json b/official/release-3.2.12/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.12/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/haptic.json b/official/release-3.2.12/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.12/json/haptic.json +++ b/official/release-3.2.12/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.12/json/iostream.json b/official/release-3.2.12/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.12/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/joystick.json b/official/release-3.2.12/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.12/json/joystick.json +++ b/official/release-3.2.12/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.12/json/keyboard.json b/official/release-3.2.12/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.12/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/opengl.json b/official/release-3.2.12/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.12/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/pen.json b/official/release-3.2.12/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.12/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/pixels.json b/official/release-3.2.12/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.12/json/pixels.json +++ b/official/release-3.2.12/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.12/json/power.json b/official/release-3.2.12/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.12/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/process.json b/official/release-3.2.12/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.12/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/scancode.json b/official/release-3.2.12/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.12/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/surface.json b/official/release-3.2.12/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.12/json/surface.json +++ b/official/release-3.2.12/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.12/json/system.json b/official/release-3.2.12/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.12/json/system.json +++ b/official/release-3.2.12/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.12/json/touch.json b/official/release-3.2.12/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.12/json/touch.json +++ b/official/release-3.2.12/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.12/json/tray.json b/official/release-3.2.12/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.12/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.12/json/video.json b/official/release-3.2.12/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.12/json/video.json +++ b/official/release-3.2.12/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.14/api/audio.zig b/official/release-3.2.14/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.14/api/audio.zig +++ b/official/release-3.2.14/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.14/api/blendmode.zig b/official/release-3.2.14/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.14/api/blendmode.zig +++ b/official/release-3.2.14/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.14/api/c.zig b/official/release-3.2.14/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.14/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.14/api/camera.zig b/official/release-3.2.14/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.14/api/camera.zig +++ b/official/release-3.2.14/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.14/api/clipboard.zig b/official/release-3.2.14/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.14/api/clipboard.zig +++ b/official/release-3.2.14/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.14/api/dialog.zig b/official/release-3.2.14/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.14/api/dialog.zig +++ b/official/release-3.2.14/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.14/api/error.zig b/official/release-3.2.14/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.14/api/error.zig +++ b/official/release-3.2.14/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.14/api/events.zig b/official/release-3.2.14/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.14/api/events.zig +++ b/official/release-3.2.14/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.14/api/filesystem.zig b/official/release-3.2.14/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.14/api/filesystem.zig +++ b/official/release-3.2.14/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.14/api/gamepad.zig b/official/release-3.2.14/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.14/api/gamepad.zig +++ b/official/release-3.2.14/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.14/api/gpu.zig b/official/release-3.2.14/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.14/api/gpu.zig +++ b/official/release-3.2.14/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.14/api/guid.zig b/official/release-3.2.14/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.14/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.14/api/haptic.zig b/official/release-3.2.14/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.14/api/haptic.zig +++ b/official/release-3.2.14/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.14/api/hints.zig b/official/release-3.2.14/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.14/api/hints.zig +++ b/official/release-3.2.14/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.14/api/init.zig b/official/release-3.2.14/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.14/api/init.zig +++ b/official/release-3.2.14/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.14/api/iostream.zig b/official/release-3.2.14/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.14/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.14/api/joystick.zig b/official/release-3.2.14/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.14/api/joystick.zig +++ b/official/release-3.2.14/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.14/api/keyboard.zig b/official/release-3.2.14/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.14/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.14/api/keycode.zig b/official/release-3.2.14/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.14/api/keycode.zig +++ b/official/release-3.2.14/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.14/api/loadso.zig b/official/release-3.2.14/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.14/api/loadso.zig +++ b/official/release-3.2.14/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.14/api/messagebox.zig b/official/release-3.2.14/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.14/api/messagebox.zig +++ b/official/release-3.2.14/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.14/api/misc.zig b/official/release-3.2.14/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.14/api/misc.zig +++ b/official/release-3.2.14/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.14/api/mouse.zig b/official/release-3.2.14/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.14/api/mouse.zig +++ b/official/release-3.2.14/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.14/api/opengl.zig b/official/release-3.2.14/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.14/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.14/api/pen.zig b/official/release-3.2.14/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.14/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.14/api/pixels.zig b/official/release-3.2.14/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.14/api/pixels.zig +++ b/official/release-3.2.14/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.14/api/power.zig b/official/release-3.2.14/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.14/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.14/api/process.zig b/official/release-3.2.14/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.14/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.14/api/properties.zig b/official/release-3.2.14/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.14/api/properties.zig +++ b/official/release-3.2.14/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.14/api/rect.zig b/official/release-3.2.14/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.14/api/rect.zig +++ b/official/release-3.2.14/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.14/api/render.zig b/official/release-3.2.14/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.14/api/render.zig +++ b/official/release-3.2.14/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.14/api/scancode.zig b/official/release-3.2.14/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.14/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.14/api/sensor.zig b/official/release-3.2.14/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.14/api/sensor.zig +++ b/official/release-3.2.14/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.14/api/stdinc.zig b/official/release-3.2.14/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.14/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.14/api/storage.zig b/official/release-3.2.14/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.14/api/storage.zig +++ b/official/release-3.2.14/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.14/api/surface.zig b/official/release-3.2.14/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.14/api/surface.zig +++ b/official/release-3.2.14/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.14/api/system.zig b/official/release-3.2.14/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.14/api/system.zig +++ b/official/release-3.2.14/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.14/api/time.zig b/official/release-3.2.14/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.14/api/time.zig +++ b/official/release-3.2.14/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.14/api/timer.zig b/official/release-3.2.14/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.14/api/timer.zig +++ b/official/release-3.2.14/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.14/api/touch.zig b/official/release-3.2.14/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.14/api/touch.zig +++ b/official/release-3.2.14/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.14/api/tray.zig b/official/release-3.2.14/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.14/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.14/api/version.zig b/official/release-3.2.14/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.14/api/version.zig +++ b/official/release-3.2.14/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.14/api/video.zig b/official/release-3.2.14/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.14/api/video.zig +++ b/official/release-3.2.14/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.14/json/audio.json b/official/release-3.2.14/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.14/json/audio.json +++ b/official/release-3.2.14/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.14/json/blendmode.json b/official/release-3.2.14/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.14/json/blendmode.json +++ b/official/release-3.2.14/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.14/json/events.json b/official/release-3.2.14/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.14/json/events.json +++ b/official/release-3.2.14/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.14/json/filesystem.json b/official/release-3.2.14/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.14/json/filesystem.json +++ b/official/release-3.2.14/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.14/json/gamepad.json b/official/release-3.2.14/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.14/json/gamepad.json +++ b/official/release-3.2.14/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.14/json/gpu.json b/official/release-3.2.14/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.14/json/gpu.json +++ b/official/release-3.2.14/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.14/json/guid.json b/official/release-3.2.14/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.14/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/haptic.json b/official/release-3.2.14/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.14/json/haptic.json +++ b/official/release-3.2.14/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.14/json/iostream.json b/official/release-3.2.14/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.14/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/joystick.json b/official/release-3.2.14/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.14/json/joystick.json +++ b/official/release-3.2.14/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.14/json/keyboard.json b/official/release-3.2.14/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.14/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/opengl.json b/official/release-3.2.14/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.14/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/pen.json b/official/release-3.2.14/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.14/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/pixels.json b/official/release-3.2.14/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.14/json/pixels.json +++ b/official/release-3.2.14/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.14/json/power.json b/official/release-3.2.14/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.14/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/process.json b/official/release-3.2.14/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.14/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/scancode.json b/official/release-3.2.14/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.14/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/surface.json b/official/release-3.2.14/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.14/json/surface.json +++ b/official/release-3.2.14/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.14/json/system.json b/official/release-3.2.14/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.14/json/system.json +++ b/official/release-3.2.14/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.14/json/touch.json b/official/release-3.2.14/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.14/json/touch.json +++ b/official/release-3.2.14/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.14/json/tray.json b/official/release-3.2.14/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.14/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.14/json/video.json b/official/release-3.2.14/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.14/json/video.json +++ b/official/release-3.2.14/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.16/api/audio.zig b/official/release-3.2.16/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.16/api/audio.zig +++ b/official/release-3.2.16/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.16/api/blendmode.zig b/official/release-3.2.16/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.16/api/blendmode.zig +++ b/official/release-3.2.16/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.16/api/c.zig b/official/release-3.2.16/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.16/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.16/api/camera.zig b/official/release-3.2.16/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.16/api/camera.zig +++ b/official/release-3.2.16/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.16/api/clipboard.zig b/official/release-3.2.16/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.16/api/clipboard.zig +++ b/official/release-3.2.16/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.16/api/dialog.zig b/official/release-3.2.16/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.16/api/dialog.zig +++ b/official/release-3.2.16/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.16/api/error.zig b/official/release-3.2.16/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.16/api/error.zig +++ b/official/release-3.2.16/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.16/api/events.zig b/official/release-3.2.16/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.16/api/events.zig +++ b/official/release-3.2.16/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.16/api/filesystem.zig b/official/release-3.2.16/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.16/api/filesystem.zig +++ b/official/release-3.2.16/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.16/api/gamepad.zig b/official/release-3.2.16/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.16/api/gamepad.zig +++ b/official/release-3.2.16/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.16/api/gpu.zig b/official/release-3.2.16/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.16/api/gpu.zig +++ b/official/release-3.2.16/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.16/api/guid.zig b/official/release-3.2.16/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.16/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.16/api/haptic.zig b/official/release-3.2.16/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.16/api/haptic.zig +++ b/official/release-3.2.16/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.16/api/hints.zig b/official/release-3.2.16/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.16/api/hints.zig +++ b/official/release-3.2.16/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.16/api/init.zig b/official/release-3.2.16/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.16/api/init.zig +++ b/official/release-3.2.16/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.16/api/iostream.zig b/official/release-3.2.16/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.16/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.16/api/joystick.zig b/official/release-3.2.16/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.16/api/joystick.zig +++ b/official/release-3.2.16/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.16/api/keyboard.zig b/official/release-3.2.16/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.16/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.16/api/keycode.zig b/official/release-3.2.16/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.16/api/keycode.zig +++ b/official/release-3.2.16/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.16/api/loadso.zig b/official/release-3.2.16/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.16/api/loadso.zig +++ b/official/release-3.2.16/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.16/api/messagebox.zig b/official/release-3.2.16/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.16/api/messagebox.zig +++ b/official/release-3.2.16/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.16/api/misc.zig b/official/release-3.2.16/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.16/api/misc.zig +++ b/official/release-3.2.16/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.16/api/mouse.zig b/official/release-3.2.16/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.16/api/mouse.zig +++ b/official/release-3.2.16/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.16/api/opengl.zig b/official/release-3.2.16/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.16/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.16/api/pen.zig b/official/release-3.2.16/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.16/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.16/api/pixels.zig b/official/release-3.2.16/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.16/api/pixels.zig +++ b/official/release-3.2.16/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.16/api/power.zig b/official/release-3.2.16/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.16/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.16/api/process.zig b/official/release-3.2.16/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.16/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.16/api/properties.zig b/official/release-3.2.16/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.16/api/properties.zig +++ b/official/release-3.2.16/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.16/api/rect.zig b/official/release-3.2.16/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.16/api/rect.zig +++ b/official/release-3.2.16/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.16/api/render.zig b/official/release-3.2.16/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.16/api/render.zig +++ b/official/release-3.2.16/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.16/api/scancode.zig b/official/release-3.2.16/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.16/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.16/api/sensor.zig b/official/release-3.2.16/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.16/api/sensor.zig +++ b/official/release-3.2.16/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.16/api/stdinc.zig b/official/release-3.2.16/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.16/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.16/api/storage.zig b/official/release-3.2.16/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.16/api/storage.zig +++ b/official/release-3.2.16/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.16/api/surface.zig b/official/release-3.2.16/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.16/api/surface.zig +++ b/official/release-3.2.16/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.16/api/system.zig b/official/release-3.2.16/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.16/api/system.zig +++ b/official/release-3.2.16/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.16/api/time.zig b/official/release-3.2.16/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.16/api/time.zig +++ b/official/release-3.2.16/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.16/api/timer.zig b/official/release-3.2.16/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.16/api/timer.zig +++ b/official/release-3.2.16/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.16/api/touch.zig b/official/release-3.2.16/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.16/api/touch.zig +++ b/official/release-3.2.16/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.16/api/tray.zig b/official/release-3.2.16/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.16/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.16/api/version.zig b/official/release-3.2.16/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.16/api/version.zig +++ b/official/release-3.2.16/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.16/api/video.zig b/official/release-3.2.16/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.16/api/video.zig +++ b/official/release-3.2.16/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.16/json/audio.json b/official/release-3.2.16/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.16/json/audio.json +++ b/official/release-3.2.16/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.16/json/blendmode.json b/official/release-3.2.16/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.16/json/blendmode.json +++ b/official/release-3.2.16/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.16/json/events.json b/official/release-3.2.16/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.16/json/events.json +++ b/official/release-3.2.16/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.16/json/filesystem.json b/official/release-3.2.16/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.16/json/filesystem.json +++ b/official/release-3.2.16/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.16/json/gamepad.json b/official/release-3.2.16/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.16/json/gamepad.json +++ b/official/release-3.2.16/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.16/json/gpu.json b/official/release-3.2.16/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.16/json/gpu.json +++ b/official/release-3.2.16/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.16/json/guid.json b/official/release-3.2.16/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.16/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/haptic.json b/official/release-3.2.16/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.16/json/haptic.json +++ b/official/release-3.2.16/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.16/json/iostream.json b/official/release-3.2.16/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.16/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/joystick.json b/official/release-3.2.16/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.16/json/joystick.json +++ b/official/release-3.2.16/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.16/json/keyboard.json b/official/release-3.2.16/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.16/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/opengl.json b/official/release-3.2.16/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.16/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/pen.json b/official/release-3.2.16/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.16/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/pixels.json b/official/release-3.2.16/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.16/json/pixels.json +++ b/official/release-3.2.16/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.16/json/power.json b/official/release-3.2.16/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.16/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/process.json b/official/release-3.2.16/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.16/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/scancode.json b/official/release-3.2.16/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.16/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/surface.json b/official/release-3.2.16/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.16/json/surface.json +++ b/official/release-3.2.16/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.16/json/system.json b/official/release-3.2.16/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.16/json/system.json +++ b/official/release-3.2.16/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.16/json/touch.json b/official/release-3.2.16/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.16/json/touch.json +++ b/official/release-3.2.16/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.16/json/tray.json b/official/release-3.2.16/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.16/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.16/json/video.json b/official/release-3.2.16/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.16/json/video.json +++ b/official/release-3.2.16/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.18/api/audio.zig b/official/release-3.2.18/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.18/api/audio.zig +++ b/official/release-3.2.18/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.18/api/blendmode.zig b/official/release-3.2.18/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.18/api/blendmode.zig +++ b/official/release-3.2.18/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.18/api/c.zig b/official/release-3.2.18/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.18/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.18/api/camera.zig b/official/release-3.2.18/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.18/api/camera.zig +++ b/official/release-3.2.18/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.18/api/clipboard.zig b/official/release-3.2.18/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.18/api/clipboard.zig +++ b/official/release-3.2.18/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.18/api/dialog.zig b/official/release-3.2.18/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.18/api/dialog.zig +++ b/official/release-3.2.18/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.18/api/error.zig b/official/release-3.2.18/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.18/api/error.zig +++ b/official/release-3.2.18/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.18/api/events.zig b/official/release-3.2.18/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.18/api/events.zig +++ b/official/release-3.2.18/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.18/api/filesystem.zig b/official/release-3.2.18/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.18/api/filesystem.zig +++ b/official/release-3.2.18/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.18/api/gamepad.zig b/official/release-3.2.18/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.18/api/gamepad.zig +++ b/official/release-3.2.18/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.18/api/gpu.zig b/official/release-3.2.18/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.18/api/gpu.zig +++ b/official/release-3.2.18/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.18/api/guid.zig b/official/release-3.2.18/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.18/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.18/api/haptic.zig b/official/release-3.2.18/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.18/api/haptic.zig +++ b/official/release-3.2.18/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.18/api/hints.zig b/official/release-3.2.18/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.18/api/hints.zig +++ b/official/release-3.2.18/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.18/api/init.zig b/official/release-3.2.18/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.18/api/init.zig +++ b/official/release-3.2.18/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.18/api/iostream.zig b/official/release-3.2.18/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.18/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.18/api/joystick.zig b/official/release-3.2.18/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.18/api/joystick.zig +++ b/official/release-3.2.18/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.18/api/keyboard.zig b/official/release-3.2.18/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.18/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.18/api/keycode.zig b/official/release-3.2.18/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.18/api/keycode.zig +++ b/official/release-3.2.18/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.18/api/loadso.zig b/official/release-3.2.18/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.18/api/loadso.zig +++ b/official/release-3.2.18/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.18/api/messagebox.zig b/official/release-3.2.18/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.18/api/messagebox.zig +++ b/official/release-3.2.18/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.18/api/misc.zig b/official/release-3.2.18/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.18/api/misc.zig +++ b/official/release-3.2.18/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.18/api/mouse.zig b/official/release-3.2.18/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.18/api/mouse.zig +++ b/official/release-3.2.18/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.18/api/opengl.zig b/official/release-3.2.18/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.18/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.18/api/pen.zig b/official/release-3.2.18/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.18/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.18/api/pixels.zig b/official/release-3.2.18/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.18/api/pixels.zig +++ b/official/release-3.2.18/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.18/api/power.zig b/official/release-3.2.18/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.18/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.18/api/process.zig b/official/release-3.2.18/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.18/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.18/api/properties.zig b/official/release-3.2.18/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.18/api/properties.zig +++ b/official/release-3.2.18/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.18/api/rect.zig b/official/release-3.2.18/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.18/api/rect.zig +++ b/official/release-3.2.18/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.18/api/render.zig b/official/release-3.2.18/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.18/api/render.zig +++ b/official/release-3.2.18/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.18/api/scancode.zig b/official/release-3.2.18/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.18/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.18/api/sensor.zig b/official/release-3.2.18/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.18/api/sensor.zig +++ b/official/release-3.2.18/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.18/api/stdinc.zig b/official/release-3.2.18/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.18/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.18/api/storage.zig b/official/release-3.2.18/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.18/api/storage.zig +++ b/official/release-3.2.18/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.18/api/surface.zig b/official/release-3.2.18/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.18/api/surface.zig +++ b/official/release-3.2.18/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.18/api/system.zig b/official/release-3.2.18/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.18/api/system.zig +++ b/official/release-3.2.18/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.18/api/time.zig b/official/release-3.2.18/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.18/api/time.zig +++ b/official/release-3.2.18/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.18/api/timer.zig b/official/release-3.2.18/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.18/api/timer.zig +++ b/official/release-3.2.18/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.18/api/touch.zig b/official/release-3.2.18/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.18/api/touch.zig +++ b/official/release-3.2.18/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.18/api/tray.zig b/official/release-3.2.18/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.18/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.18/api/version.zig b/official/release-3.2.18/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.18/api/version.zig +++ b/official/release-3.2.18/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.18/api/video.zig b/official/release-3.2.18/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.18/api/video.zig +++ b/official/release-3.2.18/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.18/json/audio.json b/official/release-3.2.18/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.18/json/audio.json +++ b/official/release-3.2.18/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.18/json/blendmode.json b/official/release-3.2.18/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.18/json/blendmode.json +++ b/official/release-3.2.18/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.18/json/events.json b/official/release-3.2.18/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.18/json/events.json +++ b/official/release-3.2.18/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.18/json/filesystem.json b/official/release-3.2.18/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.18/json/filesystem.json +++ b/official/release-3.2.18/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.18/json/gamepad.json b/official/release-3.2.18/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.18/json/gamepad.json +++ b/official/release-3.2.18/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.18/json/gpu.json b/official/release-3.2.18/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.18/json/gpu.json +++ b/official/release-3.2.18/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.18/json/guid.json b/official/release-3.2.18/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.18/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/haptic.json b/official/release-3.2.18/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.18/json/haptic.json +++ b/official/release-3.2.18/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.18/json/iostream.json b/official/release-3.2.18/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.18/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/joystick.json b/official/release-3.2.18/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.18/json/joystick.json +++ b/official/release-3.2.18/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.18/json/keyboard.json b/official/release-3.2.18/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.18/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/opengl.json b/official/release-3.2.18/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.18/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/pen.json b/official/release-3.2.18/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.18/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/pixels.json b/official/release-3.2.18/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.18/json/pixels.json +++ b/official/release-3.2.18/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.18/json/power.json b/official/release-3.2.18/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.18/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/process.json b/official/release-3.2.18/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.18/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/scancode.json b/official/release-3.2.18/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.18/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/surface.json b/official/release-3.2.18/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.18/json/surface.json +++ b/official/release-3.2.18/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.18/json/system.json b/official/release-3.2.18/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.18/json/system.json +++ b/official/release-3.2.18/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.18/json/touch.json b/official/release-3.2.18/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.18/json/touch.json +++ b/official/release-3.2.18/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.18/json/tray.json b/official/release-3.2.18/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.18/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.18/json/video.json b/official/release-3.2.18/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.18/json/video.json +++ b/official/release-3.2.18/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.2/api/audio.zig b/official/release-3.2.2/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.2/api/audio.zig +++ b/official/release-3.2.2/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.2/api/blendmode.zig b/official/release-3.2.2/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.2/api/blendmode.zig +++ b/official/release-3.2.2/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.2/api/c.zig b/official/release-3.2.2/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.2/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.2/api/camera.zig b/official/release-3.2.2/api/camera.zig index 5d16142..7a9ccd3 100644 --- a/official/release-3.2.2/api/camera.zig +++ b/official/release-3.2.2/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.2/api/clipboard.zig b/official/release-3.2.2/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.2/api/clipboard.zig +++ b/official/release-3.2.2/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.2/api/dialog.zig b/official/release-3.2.2/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.2/api/dialog.zig +++ b/official/release-3.2.2/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.2/api/error.zig b/official/release-3.2.2/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.2/api/error.zig +++ b/official/release-3.2.2/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.2/api/events.zig b/official/release-3.2.2/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.2/api/events.zig +++ b/official/release-3.2.2/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.2/api/filesystem.zig b/official/release-3.2.2/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.2/api/filesystem.zig +++ b/official/release-3.2.2/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.2/api/gamepad.zig b/official/release-3.2.2/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.2/api/gamepad.zig +++ b/official/release-3.2.2/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.2/api/gpu.zig b/official/release-3.2.2/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/official/release-3.2.2/api/gpu.zig +++ b/official/release-3.2.2/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.2/api/guid.zig b/official/release-3.2.2/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.2/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.2/api/haptic.zig b/official/release-3.2.2/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.2/api/haptic.zig +++ b/official/release-3.2.2/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.2/api/hints.zig b/official/release-3.2.2/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.2/api/hints.zig +++ b/official/release-3.2.2/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.2/api/init.zig b/official/release-3.2.2/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.2/api/init.zig +++ b/official/release-3.2.2/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.2/api/iostream.zig b/official/release-3.2.2/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.2/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.2/api/joystick.zig b/official/release-3.2.2/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.2/api/joystick.zig +++ b/official/release-3.2.2/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.2/api/keyboard.zig b/official/release-3.2.2/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.2/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.2/api/keycode.zig b/official/release-3.2.2/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.2/api/keycode.zig +++ b/official/release-3.2.2/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.2/api/loadso.zig b/official/release-3.2.2/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.2/api/loadso.zig +++ b/official/release-3.2.2/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.2/api/messagebox.zig b/official/release-3.2.2/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.2/api/messagebox.zig +++ b/official/release-3.2.2/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.2/api/misc.zig b/official/release-3.2.2/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.2/api/misc.zig +++ b/official/release-3.2.2/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.2/api/mouse.zig b/official/release-3.2.2/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.2/api/mouse.zig +++ b/official/release-3.2.2/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.2/api/opengl.zig b/official/release-3.2.2/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.2/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.2/api/pen.zig b/official/release-3.2.2/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.2/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.2/api/pixels.zig b/official/release-3.2.2/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/official/release-3.2.2/api/pixels.zig +++ b/official/release-3.2.2/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.2/api/power.zig b/official/release-3.2.2/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.2/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.2/api/process.zig b/official/release-3.2.2/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.2/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.2/api/properties.zig b/official/release-3.2.2/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.2/api/properties.zig +++ b/official/release-3.2.2/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.2/api/rect.zig b/official/release-3.2.2/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.2/api/rect.zig +++ b/official/release-3.2.2/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.2/api/render.zig b/official/release-3.2.2/api/render.zig index aaad785..0c57be7 100644 --- a/official/release-3.2.2/api/render.zig +++ b/official/release-3.2.2/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.2/api/scancode.zig b/official/release-3.2.2/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.2/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.2/api/sensor.zig b/official/release-3.2.2/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.2/api/sensor.zig +++ b/official/release-3.2.2/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.2/api/stdinc.zig b/official/release-3.2.2/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.2/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.2/api/storage.zig b/official/release-3.2.2/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.2/api/storage.zig +++ b/official/release-3.2.2/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.2/api/surface.zig b/official/release-3.2.2/api/surface.zig index 64a300e..22787cd 100644 --- a/official/release-3.2.2/api/surface.zig +++ b/official/release-3.2.2/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,226 +39,230 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.2/api/system.zig b/official/release-3.2.2/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.2/api/system.zig +++ b/official/release-3.2.2/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.2/api/time.zig b/official/release-3.2.2/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.2/api/time.zig +++ b/official/release-3.2.2/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.2/api/timer.zig b/official/release-3.2.2/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.2/api/timer.zig +++ b/official/release-3.2.2/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.2/api/touch.zig b/official/release-3.2.2/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.2/api/touch.zig +++ b/official/release-3.2.2/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.2/api/tray.zig b/official/release-3.2.2/api/tray.zig new file mode 100644 index 0000000..2d6248a --- /dev/null +++ b/official/release-3.2.2/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, size: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), size))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.2/api/version.zig b/official/release-3.2.2/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.2/api/version.zig +++ b/official/release-3.2.2/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.2/api/video.zig b/official/release-3.2.2/api/video.zig index 9125b0e..e43f76c 100644 --- a/official/release-3.2.2/api/video.zig +++ b/official/release-3.2.2/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.2/json/audio.json b/official/release-3.2.2/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.2/json/audio.json +++ b/official/release-3.2.2/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.2/json/blendmode.json b/official/release-3.2.2/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.2/json/blendmode.json +++ b/official/release-3.2.2/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.2/json/events.json b/official/release-3.2.2/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.2/json/events.json +++ b/official/release-3.2.2/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.2/json/filesystem.json b/official/release-3.2.2/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.2/json/filesystem.json +++ b/official/release-3.2.2/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.2/json/gamepad.json b/official/release-3.2.2/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.2/json/gamepad.json +++ b/official/release-3.2.2/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.2/json/gpu.json b/official/release-3.2.2/json/gpu.json index b1de6d6..a63962c 100644 --- a/official/release-3.2.2/json/gpu.json +++ b/official/release-3.2.2/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.2/json/guid.json b/official/release-3.2.2/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.2/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/haptic.json b/official/release-3.2.2/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.2/json/haptic.json +++ b/official/release-3.2.2/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.2/json/iostream.json b/official/release-3.2.2/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.2/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/joystick.json b/official/release-3.2.2/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.2/json/joystick.json +++ b/official/release-3.2.2/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.2/json/keyboard.json b/official/release-3.2.2/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.2/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/opengl.json b/official/release-3.2.2/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.2/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/pen.json b/official/release-3.2.2/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.2/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/pixels.json b/official/release-3.2.2/json/pixels.json index 3767023..da971fa 100644 --- a/official/release-3.2.2/json/pixels.json +++ b/official/release-3.2.2/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.2/json/power.json b/official/release-3.2.2/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.2/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/process.json b/official/release-3.2.2/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.2/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/scancode.json b/official/release-3.2.2/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.2/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/system.json b/official/release-3.2.2/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.2/json/system.json +++ b/official/release-3.2.2/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.2/json/touch.json b/official/release-3.2.2/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.2/json/touch.json +++ b/official/release-3.2.2/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.2/json/tray.json b/official/release-3.2.2/json/tray.json new file mode 100644 index 0000000..949e5a5 --- /dev/null +++ b/official/release-3.2.2/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "size", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.2/json/video.json b/official/release-3.2.2/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.2/json/video.json +++ b/official/release-3.2.2/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.20/api/audio.zig b/official/release-3.2.20/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.20/api/audio.zig +++ b/official/release-3.2.20/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.20/api/blendmode.zig b/official/release-3.2.20/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.20/api/blendmode.zig +++ b/official/release-3.2.20/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.20/api/c.zig b/official/release-3.2.20/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.20/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.20/api/camera.zig b/official/release-3.2.20/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.20/api/camera.zig +++ b/official/release-3.2.20/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.20/api/clipboard.zig b/official/release-3.2.20/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.20/api/clipboard.zig +++ b/official/release-3.2.20/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.20/api/dialog.zig b/official/release-3.2.20/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.20/api/dialog.zig +++ b/official/release-3.2.20/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.20/api/error.zig b/official/release-3.2.20/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.20/api/error.zig +++ b/official/release-3.2.20/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.20/api/events.zig b/official/release-3.2.20/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.20/api/events.zig +++ b/official/release-3.2.20/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.20/api/filesystem.zig b/official/release-3.2.20/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.20/api/filesystem.zig +++ b/official/release-3.2.20/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.20/api/gamepad.zig b/official/release-3.2.20/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.20/api/gamepad.zig +++ b/official/release-3.2.20/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.20/api/gpu.zig b/official/release-3.2.20/api/gpu.zig index 4f893ef..5aa5a62 100644 --- a/official/release-3.2.20/api/gpu.zig +++ b/official/release-3.2.20/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.20/api/guid.zig b/official/release-3.2.20/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.20/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.20/api/haptic.zig b/official/release-3.2.20/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.20/api/haptic.zig +++ b/official/release-3.2.20/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.20/api/hints.zig b/official/release-3.2.20/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.20/api/hints.zig +++ b/official/release-3.2.20/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.20/api/init.zig b/official/release-3.2.20/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.20/api/init.zig +++ b/official/release-3.2.20/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.20/api/iostream.zig b/official/release-3.2.20/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.20/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.20/api/joystick.zig b/official/release-3.2.20/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.20/api/joystick.zig +++ b/official/release-3.2.20/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.20/api/keyboard.zig b/official/release-3.2.20/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.20/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.20/api/keycode.zig b/official/release-3.2.20/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.20/api/keycode.zig +++ b/official/release-3.2.20/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.20/api/loadso.zig b/official/release-3.2.20/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.20/api/loadso.zig +++ b/official/release-3.2.20/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.20/api/messagebox.zig b/official/release-3.2.20/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.20/api/messagebox.zig +++ b/official/release-3.2.20/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.20/api/misc.zig b/official/release-3.2.20/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.20/api/misc.zig +++ b/official/release-3.2.20/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.20/api/mouse.zig b/official/release-3.2.20/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.20/api/mouse.zig +++ b/official/release-3.2.20/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.20/api/opengl.zig b/official/release-3.2.20/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.20/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.20/api/pen.zig b/official/release-3.2.20/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.20/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.20/api/pixels.zig b/official/release-3.2.20/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.20/api/pixels.zig +++ b/official/release-3.2.20/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.20/api/power.zig b/official/release-3.2.20/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.20/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.20/api/process.zig b/official/release-3.2.20/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.20/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.20/api/properties.zig b/official/release-3.2.20/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.20/api/properties.zig +++ b/official/release-3.2.20/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.20/api/rect.zig b/official/release-3.2.20/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.20/api/rect.zig +++ b/official/release-3.2.20/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.20/api/render.zig b/official/release-3.2.20/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.20/api/render.zig +++ b/official/release-3.2.20/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.20/api/scancode.zig b/official/release-3.2.20/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.20/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.20/api/sensor.zig b/official/release-3.2.20/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.20/api/sensor.zig +++ b/official/release-3.2.20/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.20/api/stdinc.zig b/official/release-3.2.20/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.20/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.20/api/storage.zig b/official/release-3.2.20/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.20/api/storage.zig +++ b/official/release-3.2.20/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.20/api/surface.zig b/official/release-3.2.20/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.20/api/surface.zig +++ b/official/release-3.2.20/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.20/api/system.zig b/official/release-3.2.20/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.20/api/system.zig +++ b/official/release-3.2.20/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.20/api/time.zig b/official/release-3.2.20/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.20/api/time.zig +++ b/official/release-3.2.20/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.20/api/timer.zig b/official/release-3.2.20/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.20/api/timer.zig +++ b/official/release-3.2.20/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.20/api/touch.zig b/official/release-3.2.20/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.20/api/touch.zig +++ b/official/release-3.2.20/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.20/api/tray.zig b/official/release-3.2.20/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.20/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.20/api/version.zig b/official/release-3.2.20/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.20/api/version.zig +++ b/official/release-3.2.20/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.20/api/video.zig b/official/release-3.2.20/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.20/api/video.zig +++ b/official/release-3.2.20/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.20/json/audio.json b/official/release-3.2.20/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.20/json/audio.json +++ b/official/release-3.2.20/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.20/json/blendmode.json b/official/release-3.2.20/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.20/json/blendmode.json +++ b/official/release-3.2.20/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.20/json/events.json b/official/release-3.2.20/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.20/json/events.json +++ b/official/release-3.2.20/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.20/json/filesystem.json b/official/release-3.2.20/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.20/json/filesystem.json +++ b/official/release-3.2.20/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.20/json/gamepad.json b/official/release-3.2.20/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.20/json/gamepad.json +++ b/official/release-3.2.20/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.20/json/gpu.json b/official/release-3.2.20/json/gpu.json index 3202a8d..3508694 100644 --- a/official/release-3.2.20/json/gpu.json +++ b/official/release-3.2.20/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.20/json/guid.json b/official/release-3.2.20/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.20/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/haptic.json b/official/release-3.2.20/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.20/json/haptic.json +++ b/official/release-3.2.20/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.20/json/iostream.json b/official/release-3.2.20/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.20/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/joystick.json b/official/release-3.2.20/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.20/json/joystick.json +++ b/official/release-3.2.20/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.20/json/keyboard.json b/official/release-3.2.20/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.20/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/opengl.json b/official/release-3.2.20/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.20/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/pen.json b/official/release-3.2.20/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.20/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/pixels.json b/official/release-3.2.20/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.20/json/pixels.json +++ b/official/release-3.2.20/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.20/json/power.json b/official/release-3.2.20/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.20/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/process.json b/official/release-3.2.20/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.20/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/scancode.json b/official/release-3.2.20/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.20/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/surface.json b/official/release-3.2.20/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.20/json/surface.json +++ b/official/release-3.2.20/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.20/json/system.json b/official/release-3.2.20/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.20/json/system.json +++ b/official/release-3.2.20/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.20/json/touch.json b/official/release-3.2.20/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.20/json/touch.json +++ b/official/release-3.2.20/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.20/json/tray.json b/official/release-3.2.20/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.20/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.20/json/video.json b/official/release-3.2.20/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.20/json/video.json +++ b/official/release-3.2.20/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.22/api/audio.zig b/official/release-3.2.22/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.22/api/audio.zig +++ b/official/release-3.2.22/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.22/api/blendmode.zig b/official/release-3.2.22/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.22/api/blendmode.zig +++ b/official/release-3.2.22/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.22/api/c.zig b/official/release-3.2.22/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.22/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.22/api/camera.zig b/official/release-3.2.22/api/camera.zig index 80c77b8..4a2c467 100644 --- a/official/release-3.2.22/api/camera.zig +++ b/official/release-3.2.22/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.22/api/clipboard.zig b/official/release-3.2.22/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.22/api/clipboard.zig +++ b/official/release-3.2.22/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.22/api/dialog.zig b/official/release-3.2.22/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.22/api/dialog.zig +++ b/official/release-3.2.22/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.22/api/error.zig b/official/release-3.2.22/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.22/api/error.zig +++ b/official/release-3.2.22/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.22/api/events.zig b/official/release-3.2.22/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.22/api/events.zig +++ b/official/release-3.2.22/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.22/api/filesystem.zig b/official/release-3.2.22/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.22/api/filesystem.zig +++ b/official/release-3.2.22/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.22/api/gamepad.zig b/official/release-3.2.22/api/gamepad.zig index 413c625..1f8f790 100644 --- a/official/release-3.2.22/api/gamepad.zig +++ b/official/release-3.2.22/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.22/api/gpu.zig b/official/release-3.2.22/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/official/release-3.2.22/api/gpu.zig +++ b/official/release-3.2.22/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.22/api/guid.zig b/official/release-3.2.22/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.22/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.22/api/haptic.zig b/official/release-3.2.22/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.22/api/haptic.zig +++ b/official/release-3.2.22/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.22/api/hints.zig b/official/release-3.2.22/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.22/api/hints.zig +++ b/official/release-3.2.22/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.22/api/init.zig b/official/release-3.2.22/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.22/api/init.zig +++ b/official/release-3.2.22/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.22/api/iostream.zig b/official/release-3.2.22/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.22/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.22/api/joystick.zig b/official/release-3.2.22/api/joystick.zig index 3f57466..a6cee42 100644 --- a/official/release-3.2.22/api/joystick.zig +++ b/official/release-3.2.22/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.22/api/keyboard.zig b/official/release-3.2.22/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.22/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.22/api/keycode.zig b/official/release-3.2.22/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.22/api/keycode.zig +++ b/official/release-3.2.22/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.22/api/loadso.zig b/official/release-3.2.22/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.22/api/loadso.zig +++ b/official/release-3.2.22/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.22/api/messagebox.zig b/official/release-3.2.22/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.22/api/messagebox.zig +++ b/official/release-3.2.22/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.22/api/misc.zig b/official/release-3.2.22/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.22/api/misc.zig +++ b/official/release-3.2.22/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.22/api/mouse.zig b/official/release-3.2.22/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.22/api/mouse.zig +++ b/official/release-3.2.22/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.22/api/opengl.zig b/official/release-3.2.22/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.22/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.22/api/pen.zig b/official/release-3.2.22/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.22/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.22/api/pixels.zig b/official/release-3.2.22/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.22/api/pixels.zig +++ b/official/release-3.2.22/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.22/api/power.zig b/official/release-3.2.22/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.22/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.22/api/process.zig b/official/release-3.2.22/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.22/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.22/api/properties.zig b/official/release-3.2.22/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.22/api/properties.zig +++ b/official/release-3.2.22/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.22/api/rect.zig b/official/release-3.2.22/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.22/api/rect.zig +++ b/official/release-3.2.22/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.22/api/render.zig b/official/release-3.2.22/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.22/api/render.zig +++ b/official/release-3.2.22/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.22/api/scancode.zig b/official/release-3.2.22/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.22/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.22/api/sensor.zig b/official/release-3.2.22/api/sensor.zig index cc7fe67..f471675 100644 --- a/official/release-3.2.22/api/sensor.zig +++ b/official/release-3.2.22/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.22/api/stdinc.zig b/official/release-3.2.22/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.22/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.22/api/storage.zig b/official/release-3.2.22/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.22/api/storage.zig +++ b/official/release-3.2.22/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.22/api/surface.zig b/official/release-3.2.22/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.22/api/surface.zig +++ b/official/release-3.2.22/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.22/api/system.zig b/official/release-3.2.22/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.22/api/system.zig +++ b/official/release-3.2.22/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.22/api/time.zig b/official/release-3.2.22/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.22/api/time.zig +++ b/official/release-3.2.22/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.22/api/timer.zig b/official/release-3.2.22/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.22/api/timer.zig +++ b/official/release-3.2.22/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.22/api/touch.zig b/official/release-3.2.22/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.22/api/touch.zig +++ b/official/release-3.2.22/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.22/api/tray.zig b/official/release-3.2.22/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.22/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.22/api/version.zig b/official/release-3.2.22/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.22/api/version.zig +++ b/official/release-3.2.22/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.22/api/video.zig b/official/release-3.2.22/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.22/api/video.zig +++ b/official/release-3.2.22/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.22/json/audio.json b/official/release-3.2.22/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.22/json/audio.json +++ b/official/release-3.2.22/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.22/json/blendmode.json b/official/release-3.2.22/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.22/json/blendmode.json +++ b/official/release-3.2.22/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.22/json/events.json b/official/release-3.2.22/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.22/json/events.json +++ b/official/release-3.2.22/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.22/json/filesystem.json b/official/release-3.2.22/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.22/json/filesystem.json +++ b/official/release-3.2.22/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.22/json/gamepad.json b/official/release-3.2.22/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.22/json/gamepad.json +++ b/official/release-3.2.22/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.22/json/gpu.json b/official/release-3.2.22/json/gpu.json index 2bc908a..e981357 100644 --- a/official/release-3.2.22/json/gpu.json +++ b/official/release-3.2.22/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.22/json/guid.json b/official/release-3.2.22/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.22/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/haptic.json b/official/release-3.2.22/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.22/json/haptic.json +++ b/official/release-3.2.22/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.22/json/iostream.json b/official/release-3.2.22/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.22/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/joystick.json b/official/release-3.2.22/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.22/json/joystick.json +++ b/official/release-3.2.22/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.22/json/keyboard.json b/official/release-3.2.22/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.22/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/opengl.json b/official/release-3.2.22/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.22/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/pen.json b/official/release-3.2.22/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.22/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/pixels.json b/official/release-3.2.22/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.22/json/pixels.json +++ b/official/release-3.2.22/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.22/json/power.json b/official/release-3.2.22/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.22/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/process.json b/official/release-3.2.22/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.22/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/scancode.json b/official/release-3.2.22/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.22/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/surface.json b/official/release-3.2.22/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.22/json/surface.json +++ b/official/release-3.2.22/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.22/json/system.json b/official/release-3.2.22/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.22/json/system.json +++ b/official/release-3.2.22/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.22/json/touch.json b/official/release-3.2.22/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.22/json/touch.json +++ b/official/release-3.2.22/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.22/json/tray.json b/official/release-3.2.22/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.22/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.22/json/video.json b/official/release-3.2.22/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.22/json/video.json +++ b/official/release-3.2.22/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.24/api/audio.zig b/official/release-3.2.24/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.24/api/audio.zig +++ b/official/release-3.2.24/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.24/api/blendmode.zig b/official/release-3.2.24/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.24/api/blendmode.zig +++ b/official/release-3.2.24/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.24/api/c.zig b/official/release-3.2.24/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.24/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.24/api/camera.zig b/official/release-3.2.24/api/camera.zig index 80c77b8..4a2c467 100644 --- a/official/release-3.2.24/api/camera.zig +++ b/official/release-3.2.24/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.24/api/clipboard.zig b/official/release-3.2.24/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.24/api/clipboard.zig +++ b/official/release-3.2.24/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.24/api/dialog.zig b/official/release-3.2.24/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.24/api/dialog.zig +++ b/official/release-3.2.24/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.24/api/error.zig b/official/release-3.2.24/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.24/api/error.zig +++ b/official/release-3.2.24/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.24/api/events.zig b/official/release-3.2.24/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.24/api/events.zig +++ b/official/release-3.2.24/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.24/api/filesystem.zig b/official/release-3.2.24/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.24/api/filesystem.zig +++ b/official/release-3.2.24/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.24/api/gamepad.zig b/official/release-3.2.24/api/gamepad.zig index 413c625..1f8f790 100644 --- a/official/release-3.2.24/api/gamepad.zig +++ b/official/release-3.2.24/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.24/api/gpu.zig b/official/release-3.2.24/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/official/release-3.2.24/api/gpu.zig +++ b/official/release-3.2.24/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.24/api/guid.zig b/official/release-3.2.24/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.24/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.24/api/haptic.zig b/official/release-3.2.24/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.24/api/haptic.zig +++ b/official/release-3.2.24/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.24/api/hints.zig b/official/release-3.2.24/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.24/api/hints.zig +++ b/official/release-3.2.24/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.24/api/init.zig b/official/release-3.2.24/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.24/api/init.zig +++ b/official/release-3.2.24/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.24/api/iostream.zig b/official/release-3.2.24/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.24/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.24/api/joystick.zig b/official/release-3.2.24/api/joystick.zig index 3f57466..a6cee42 100644 --- a/official/release-3.2.24/api/joystick.zig +++ b/official/release-3.2.24/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.24/api/keyboard.zig b/official/release-3.2.24/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.24/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.24/api/keycode.zig b/official/release-3.2.24/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.24/api/keycode.zig +++ b/official/release-3.2.24/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.24/api/loadso.zig b/official/release-3.2.24/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.24/api/loadso.zig +++ b/official/release-3.2.24/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.24/api/messagebox.zig b/official/release-3.2.24/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.24/api/messagebox.zig +++ b/official/release-3.2.24/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.24/api/misc.zig b/official/release-3.2.24/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.24/api/misc.zig +++ b/official/release-3.2.24/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.24/api/mouse.zig b/official/release-3.2.24/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.24/api/mouse.zig +++ b/official/release-3.2.24/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.24/api/opengl.zig b/official/release-3.2.24/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.24/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.24/api/pen.zig b/official/release-3.2.24/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.24/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.24/api/pixels.zig b/official/release-3.2.24/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.24/api/pixels.zig +++ b/official/release-3.2.24/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.24/api/power.zig b/official/release-3.2.24/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.24/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.24/api/process.zig b/official/release-3.2.24/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.24/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.24/api/properties.zig b/official/release-3.2.24/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.24/api/properties.zig +++ b/official/release-3.2.24/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.24/api/rect.zig b/official/release-3.2.24/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.24/api/rect.zig +++ b/official/release-3.2.24/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.24/api/render.zig b/official/release-3.2.24/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.24/api/render.zig +++ b/official/release-3.2.24/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.24/api/scancode.zig b/official/release-3.2.24/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.24/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.24/api/sensor.zig b/official/release-3.2.24/api/sensor.zig index cc7fe67..f471675 100644 --- a/official/release-3.2.24/api/sensor.zig +++ b/official/release-3.2.24/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.24/api/stdinc.zig b/official/release-3.2.24/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.24/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.24/api/storage.zig b/official/release-3.2.24/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.24/api/storage.zig +++ b/official/release-3.2.24/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.24/api/surface.zig b/official/release-3.2.24/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.24/api/surface.zig +++ b/official/release-3.2.24/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.24/api/system.zig b/official/release-3.2.24/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.24/api/system.zig +++ b/official/release-3.2.24/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.24/api/time.zig b/official/release-3.2.24/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.24/api/time.zig +++ b/official/release-3.2.24/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.24/api/timer.zig b/official/release-3.2.24/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.24/api/timer.zig +++ b/official/release-3.2.24/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.24/api/touch.zig b/official/release-3.2.24/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.24/api/touch.zig +++ b/official/release-3.2.24/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.24/api/tray.zig b/official/release-3.2.24/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.24/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.24/api/version.zig b/official/release-3.2.24/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.24/api/version.zig +++ b/official/release-3.2.24/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.24/api/video.zig b/official/release-3.2.24/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.24/api/video.zig +++ b/official/release-3.2.24/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.24/json/audio.json b/official/release-3.2.24/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.24/json/audio.json +++ b/official/release-3.2.24/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.24/json/blendmode.json b/official/release-3.2.24/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.24/json/blendmode.json +++ b/official/release-3.2.24/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.24/json/events.json b/official/release-3.2.24/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.24/json/events.json +++ b/official/release-3.2.24/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.24/json/filesystem.json b/official/release-3.2.24/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.24/json/filesystem.json +++ b/official/release-3.2.24/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.24/json/gamepad.json b/official/release-3.2.24/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.24/json/gamepad.json +++ b/official/release-3.2.24/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.24/json/gpu.json b/official/release-3.2.24/json/gpu.json index 2bc908a..e981357 100644 --- a/official/release-3.2.24/json/gpu.json +++ b/official/release-3.2.24/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.24/json/guid.json b/official/release-3.2.24/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.24/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/haptic.json b/official/release-3.2.24/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.24/json/haptic.json +++ b/official/release-3.2.24/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.24/json/iostream.json b/official/release-3.2.24/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.24/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/joystick.json b/official/release-3.2.24/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.24/json/joystick.json +++ b/official/release-3.2.24/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.24/json/keyboard.json b/official/release-3.2.24/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.24/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/opengl.json b/official/release-3.2.24/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.24/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/pen.json b/official/release-3.2.24/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.24/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/pixels.json b/official/release-3.2.24/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.24/json/pixels.json +++ b/official/release-3.2.24/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.24/json/power.json b/official/release-3.2.24/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.24/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/process.json b/official/release-3.2.24/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.24/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/scancode.json b/official/release-3.2.24/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.24/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/surface.json b/official/release-3.2.24/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.24/json/surface.json +++ b/official/release-3.2.24/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.24/json/system.json b/official/release-3.2.24/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.24/json/system.json +++ b/official/release-3.2.24/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.24/json/touch.json b/official/release-3.2.24/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.24/json/touch.json +++ b/official/release-3.2.24/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.24/json/tray.json b/official/release-3.2.24/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.24/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.24/json/video.json b/official/release-3.2.24/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.24/json/video.json +++ b/official/release-3.2.24/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.26/api/audio.zig b/official/release-3.2.26/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.26/api/audio.zig +++ b/official/release-3.2.26/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.26/api/blendmode.zig b/official/release-3.2.26/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.26/api/blendmode.zig +++ b/official/release-3.2.26/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.26/api/c.zig b/official/release-3.2.26/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.26/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.26/api/camera.zig b/official/release-3.2.26/api/camera.zig index 80c77b8..4a2c467 100644 --- a/official/release-3.2.26/api/camera.zig +++ b/official/release-3.2.26/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.26/api/clipboard.zig b/official/release-3.2.26/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.26/api/clipboard.zig +++ b/official/release-3.2.26/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.26/api/dialog.zig b/official/release-3.2.26/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.26/api/dialog.zig +++ b/official/release-3.2.26/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.26/api/error.zig b/official/release-3.2.26/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.26/api/error.zig +++ b/official/release-3.2.26/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.26/api/events.zig b/official/release-3.2.26/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.26/api/events.zig +++ b/official/release-3.2.26/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.26/api/filesystem.zig b/official/release-3.2.26/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.26/api/filesystem.zig +++ b/official/release-3.2.26/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.26/api/gamepad.zig b/official/release-3.2.26/api/gamepad.zig index 413c625..1f8f790 100644 --- a/official/release-3.2.26/api/gamepad.zig +++ b/official/release-3.2.26/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.26/api/gpu.zig b/official/release-3.2.26/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/official/release-3.2.26/api/gpu.zig +++ b/official/release-3.2.26/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.26/api/guid.zig b/official/release-3.2.26/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.26/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.26/api/haptic.zig b/official/release-3.2.26/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.26/api/haptic.zig +++ b/official/release-3.2.26/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.26/api/hints.zig b/official/release-3.2.26/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.26/api/hints.zig +++ b/official/release-3.2.26/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.26/api/init.zig b/official/release-3.2.26/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.26/api/init.zig +++ b/official/release-3.2.26/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.26/api/iostream.zig b/official/release-3.2.26/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.26/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.26/api/joystick.zig b/official/release-3.2.26/api/joystick.zig index 3f57466..a6cee42 100644 --- a/official/release-3.2.26/api/joystick.zig +++ b/official/release-3.2.26/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.26/api/keyboard.zig b/official/release-3.2.26/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.26/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.26/api/keycode.zig b/official/release-3.2.26/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.26/api/keycode.zig +++ b/official/release-3.2.26/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.26/api/loadso.zig b/official/release-3.2.26/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.26/api/loadso.zig +++ b/official/release-3.2.26/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.26/api/messagebox.zig b/official/release-3.2.26/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.26/api/messagebox.zig +++ b/official/release-3.2.26/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.26/api/misc.zig b/official/release-3.2.26/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.26/api/misc.zig +++ b/official/release-3.2.26/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.26/api/mouse.zig b/official/release-3.2.26/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.26/api/mouse.zig +++ b/official/release-3.2.26/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.26/api/opengl.zig b/official/release-3.2.26/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.26/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.26/api/pen.zig b/official/release-3.2.26/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.26/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.26/api/pixels.zig b/official/release-3.2.26/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.26/api/pixels.zig +++ b/official/release-3.2.26/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.26/api/power.zig b/official/release-3.2.26/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.26/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.26/api/process.zig b/official/release-3.2.26/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.26/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.26/api/properties.zig b/official/release-3.2.26/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.26/api/properties.zig +++ b/official/release-3.2.26/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.26/api/rect.zig b/official/release-3.2.26/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.26/api/rect.zig +++ b/official/release-3.2.26/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.26/api/render.zig b/official/release-3.2.26/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.26/api/render.zig +++ b/official/release-3.2.26/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.26/api/scancode.zig b/official/release-3.2.26/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.26/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.26/api/sensor.zig b/official/release-3.2.26/api/sensor.zig index cc7fe67..f471675 100644 --- a/official/release-3.2.26/api/sensor.zig +++ b/official/release-3.2.26/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.26/api/stdinc.zig b/official/release-3.2.26/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.26/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.26/api/storage.zig b/official/release-3.2.26/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.26/api/storage.zig +++ b/official/release-3.2.26/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.26/api/surface.zig b/official/release-3.2.26/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.26/api/surface.zig +++ b/official/release-3.2.26/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.26/api/system.zig b/official/release-3.2.26/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.26/api/system.zig +++ b/official/release-3.2.26/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.26/api/time.zig b/official/release-3.2.26/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.26/api/time.zig +++ b/official/release-3.2.26/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.26/api/timer.zig b/official/release-3.2.26/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.26/api/timer.zig +++ b/official/release-3.2.26/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.26/api/touch.zig b/official/release-3.2.26/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.26/api/touch.zig +++ b/official/release-3.2.26/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.26/api/tray.zig b/official/release-3.2.26/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.26/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.26/api/version.zig b/official/release-3.2.26/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.26/api/version.zig +++ b/official/release-3.2.26/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.26/api/video.zig b/official/release-3.2.26/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.26/api/video.zig +++ b/official/release-3.2.26/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.26/json/audio.json b/official/release-3.2.26/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.26/json/audio.json +++ b/official/release-3.2.26/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.26/json/blendmode.json b/official/release-3.2.26/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.26/json/blendmode.json +++ b/official/release-3.2.26/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.26/json/events.json b/official/release-3.2.26/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.26/json/events.json +++ b/official/release-3.2.26/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.26/json/filesystem.json b/official/release-3.2.26/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.26/json/filesystem.json +++ b/official/release-3.2.26/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.26/json/gamepad.json b/official/release-3.2.26/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.26/json/gamepad.json +++ b/official/release-3.2.26/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.26/json/gpu.json b/official/release-3.2.26/json/gpu.json index 2bc908a..e981357 100644 --- a/official/release-3.2.26/json/gpu.json +++ b/official/release-3.2.26/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.26/json/guid.json b/official/release-3.2.26/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.26/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/haptic.json b/official/release-3.2.26/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.26/json/haptic.json +++ b/official/release-3.2.26/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.26/json/iostream.json b/official/release-3.2.26/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.26/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/joystick.json b/official/release-3.2.26/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.26/json/joystick.json +++ b/official/release-3.2.26/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.26/json/keyboard.json b/official/release-3.2.26/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.26/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/opengl.json b/official/release-3.2.26/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.26/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/pen.json b/official/release-3.2.26/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.26/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/pixels.json b/official/release-3.2.26/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.26/json/pixels.json +++ b/official/release-3.2.26/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.26/json/power.json b/official/release-3.2.26/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.26/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/process.json b/official/release-3.2.26/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.26/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/scancode.json b/official/release-3.2.26/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.26/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/surface.json b/official/release-3.2.26/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.26/json/surface.json +++ b/official/release-3.2.26/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.26/json/system.json b/official/release-3.2.26/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.26/json/system.json +++ b/official/release-3.2.26/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.26/json/touch.json b/official/release-3.2.26/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.26/json/touch.json +++ b/official/release-3.2.26/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.26/json/tray.json b/official/release-3.2.26/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.26/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.26/json/video.json b/official/release-3.2.26/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.26/json/video.json +++ b/official/release-3.2.26/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.28/api/audio.zig b/official/release-3.2.28/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.28/api/audio.zig +++ b/official/release-3.2.28/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.28/api/blendmode.zig b/official/release-3.2.28/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.28/api/blendmode.zig +++ b/official/release-3.2.28/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.28/api/c.zig b/official/release-3.2.28/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.28/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.28/api/camera.zig b/official/release-3.2.28/api/camera.zig index 80c77b8..4a2c467 100644 --- a/official/release-3.2.28/api/camera.zig +++ b/official/release-3.2.28/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.28/api/clipboard.zig b/official/release-3.2.28/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.28/api/clipboard.zig +++ b/official/release-3.2.28/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.28/api/dialog.zig b/official/release-3.2.28/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.28/api/dialog.zig +++ b/official/release-3.2.28/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.28/api/error.zig b/official/release-3.2.28/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.28/api/error.zig +++ b/official/release-3.2.28/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.28/api/events.zig b/official/release-3.2.28/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.28/api/events.zig +++ b/official/release-3.2.28/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.28/api/filesystem.zig b/official/release-3.2.28/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.28/api/filesystem.zig +++ b/official/release-3.2.28/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.28/api/gamepad.zig b/official/release-3.2.28/api/gamepad.zig index 413c625..1f8f790 100644 --- a/official/release-3.2.28/api/gamepad.zig +++ b/official/release-3.2.28/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.28/api/gpu.zig b/official/release-3.2.28/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/official/release-3.2.28/api/gpu.zig +++ b/official/release-3.2.28/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.28/api/guid.zig b/official/release-3.2.28/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.28/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.28/api/haptic.zig b/official/release-3.2.28/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.28/api/haptic.zig +++ b/official/release-3.2.28/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.28/api/hints.zig b/official/release-3.2.28/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.28/api/hints.zig +++ b/official/release-3.2.28/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.28/api/init.zig b/official/release-3.2.28/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.28/api/init.zig +++ b/official/release-3.2.28/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.28/api/iostream.zig b/official/release-3.2.28/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.28/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.28/api/joystick.zig b/official/release-3.2.28/api/joystick.zig index 3f57466..a6cee42 100644 --- a/official/release-3.2.28/api/joystick.zig +++ b/official/release-3.2.28/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.28/api/keyboard.zig b/official/release-3.2.28/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.28/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.28/api/keycode.zig b/official/release-3.2.28/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.28/api/keycode.zig +++ b/official/release-3.2.28/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.28/api/loadso.zig b/official/release-3.2.28/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.28/api/loadso.zig +++ b/official/release-3.2.28/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.28/api/messagebox.zig b/official/release-3.2.28/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.28/api/messagebox.zig +++ b/official/release-3.2.28/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.28/api/misc.zig b/official/release-3.2.28/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.28/api/misc.zig +++ b/official/release-3.2.28/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.28/api/mouse.zig b/official/release-3.2.28/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.28/api/mouse.zig +++ b/official/release-3.2.28/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.28/api/opengl.zig b/official/release-3.2.28/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.28/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.28/api/pen.zig b/official/release-3.2.28/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.28/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.28/api/pixels.zig b/official/release-3.2.28/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.28/api/pixels.zig +++ b/official/release-3.2.28/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.28/api/power.zig b/official/release-3.2.28/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.28/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.28/api/process.zig b/official/release-3.2.28/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.28/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.28/api/properties.zig b/official/release-3.2.28/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.28/api/properties.zig +++ b/official/release-3.2.28/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.28/api/rect.zig b/official/release-3.2.28/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.28/api/rect.zig +++ b/official/release-3.2.28/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.28/api/render.zig b/official/release-3.2.28/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.28/api/render.zig +++ b/official/release-3.2.28/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.28/api/scancode.zig b/official/release-3.2.28/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.28/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.28/api/sensor.zig b/official/release-3.2.28/api/sensor.zig index cc7fe67..f471675 100644 --- a/official/release-3.2.28/api/sensor.zig +++ b/official/release-3.2.28/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.28/api/stdinc.zig b/official/release-3.2.28/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.28/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.28/api/storage.zig b/official/release-3.2.28/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.28/api/storage.zig +++ b/official/release-3.2.28/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.28/api/surface.zig b/official/release-3.2.28/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.28/api/surface.zig +++ b/official/release-3.2.28/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.28/api/system.zig b/official/release-3.2.28/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.28/api/system.zig +++ b/official/release-3.2.28/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.28/api/time.zig b/official/release-3.2.28/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.28/api/time.zig +++ b/official/release-3.2.28/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.28/api/timer.zig b/official/release-3.2.28/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.28/api/timer.zig +++ b/official/release-3.2.28/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.28/api/touch.zig b/official/release-3.2.28/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.28/api/touch.zig +++ b/official/release-3.2.28/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.28/api/tray.zig b/official/release-3.2.28/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.28/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.28/api/version.zig b/official/release-3.2.28/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.28/api/version.zig +++ b/official/release-3.2.28/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.28/api/video.zig b/official/release-3.2.28/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.28/api/video.zig +++ b/official/release-3.2.28/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.28/json/audio.json b/official/release-3.2.28/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.28/json/audio.json +++ b/official/release-3.2.28/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.28/json/blendmode.json b/official/release-3.2.28/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.28/json/blendmode.json +++ b/official/release-3.2.28/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.28/json/events.json b/official/release-3.2.28/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.28/json/events.json +++ b/official/release-3.2.28/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.28/json/filesystem.json b/official/release-3.2.28/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.28/json/filesystem.json +++ b/official/release-3.2.28/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.28/json/gamepad.json b/official/release-3.2.28/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.28/json/gamepad.json +++ b/official/release-3.2.28/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.28/json/gpu.json b/official/release-3.2.28/json/gpu.json index 2bc908a..e981357 100644 --- a/official/release-3.2.28/json/gpu.json +++ b/official/release-3.2.28/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.28/json/guid.json b/official/release-3.2.28/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.28/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/haptic.json b/official/release-3.2.28/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.28/json/haptic.json +++ b/official/release-3.2.28/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.28/json/iostream.json b/official/release-3.2.28/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.28/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/joystick.json b/official/release-3.2.28/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.28/json/joystick.json +++ b/official/release-3.2.28/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.28/json/keyboard.json b/official/release-3.2.28/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.28/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/opengl.json b/official/release-3.2.28/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.28/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/pen.json b/official/release-3.2.28/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.28/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/pixels.json b/official/release-3.2.28/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.28/json/pixels.json +++ b/official/release-3.2.28/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.28/json/power.json b/official/release-3.2.28/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.28/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/process.json b/official/release-3.2.28/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.28/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/scancode.json b/official/release-3.2.28/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.28/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/surface.json b/official/release-3.2.28/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.28/json/surface.json +++ b/official/release-3.2.28/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.28/json/system.json b/official/release-3.2.28/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.28/json/system.json +++ b/official/release-3.2.28/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.28/json/touch.json b/official/release-3.2.28/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.28/json/touch.json +++ b/official/release-3.2.28/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.28/json/tray.json b/official/release-3.2.28/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.28/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.28/json/video.json b/official/release-3.2.28/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.28/json/video.json +++ b/official/release-3.2.28/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.30/api/audio.zig b/official/release-3.2.30/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.30/api/audio.zig +++ b/official/release-3.2.30/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.30/api/blendmode.zig b/official/release-3.2.30/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.30/api/blendmode.zig +++ b/official/release-3.2.30/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.30/api/c.zig b/official/release-3.2.30/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.30/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.30/api/camera.zig b/official/release-3.2.30/api/camera.zig index 80c77b8..4a2c467 100644 --- a/official/release-3.2.30/api/camera.zig +++ b/official/release-3.2.30/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.30/api/clipboard.zig b/official/release-3.2.30/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.30/api/clipboard.zig +++ b/official/release-3.2.30/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.30/api/dialog.zig b/official/release-3.2.30/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.30/api/dialog.zig +++ b/official/release-3.2.30/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.30/api/error.zig b/official/release-3.2.30/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.30/api/error.zig +++ b/official/release-3.2.30/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.30/api/events.zig b/official/release-3.2.30/api/events.zig index 09ca428..2a900b5 100644 --- a/official/release-3.2.30/api/events.zig +++ b/official/release-3.2.30/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -423,6 +314,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -702,7 +594,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -722,19 +614,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -744,7 +636,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -772,5 +664,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.30/api/filesystem.zig b/official/release-3.2.30/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.30/api/filesystem.zig +++ b/official/release-3.2.30/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.30/api/gamepad.zig b/official/release-3.2.30/api/gamepad.zig index 413c625..1f8f790 100644 --- a/official/release-3.2.30/api/gamepad.zig +++ b/official/release-3.2.30/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -221,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -263,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -273,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -284,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -292,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -308,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -329,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -345,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -357,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -381,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.30/api/gpu.zig b/official/release-3.2.30/api/gpu.zig index bd2bc3f..acda7e3 100644 --- a/official/release-3.2.30/api/gpu.zig +++ b/official/release-3.2.30/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.30/api/guid.zig b/official/release-3.2.30/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.30/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.30/api/haptic.zig b/official/release-3.2.30/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.30/api/haptic.zig +++ b/official/release-3.2.30/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.30/api/hints.zig b/official/release-3.2.30/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.30/api/hints.zig +++ b/official/release-3.2.30/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.30/api/init.zig b/official/release-3.2.30/api/init.zig index 1c0d191..f2f7c11 100644 --- a/official/release-3.2.30/api/init.zig +++ b/official/release-3.2.30/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.30/api/iostream.zig b/official/release-3.2.30/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.30/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.30/api/joystick.zig b/official/release-3.2.30/api/joystick.zig index 3f57466..a6cee42 100644 --- a/official/release-3.2.30/api/joystick.zig +++ b/official/release-3.2.30/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -208,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -305,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.30/api/keyboard.zig b/official/release-3.2.30/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.30/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.30/api/keycode.zig b/official/release-3.2.30/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.30/api/keycode.zig +++ b/official/release-3.2.30/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.30/api/loadso.zig b/official/release-3.2.30/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.30/api/loadso.zig +++ b/official/release-3.2.30/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.30/api/messagebox.zig b/official/release-3.2.30/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.30/api/messagebox.zig +++ b/official/release-3.2.30/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.30/api/misc.zig b/official/release-3.2.30/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.30/api/misc.zig +++ b/official/release-3.2.30/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.30/api/mouse.zig b/official/release-3.2.30/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.30/api/mouse.zig +++ b/official/release-3.2.30/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.30/api/opengl.zig b/official/release-3.2.30/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.30/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.30/api/pen.zig b/official/release-3.2.30/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.30/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.30/api/pixels.zig b/official/release-3.2.30/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.30/api/pixels.zig +++ b/official/release-3.2.30/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.30/api/power.zig b/official/release-3.2.30/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.30/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.30/api/process.zig b/official/release-3.2.30/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.30/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.30/api/properties.zig b/official/release-3.2.30/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.30/api/properties.zig +++ b/official/release-3.2.30/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.30/api/rect.zig b/official/release-3.2.30/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.30/api/rect.zig +++ b/official/release-3.2.30/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.30/api/render.zig b/official/release-3.2.30/api/render.zig index 8e3717a..0c57be7 100644 --- a/official/release-3.2.30/api/render.zig +++ b/official/release-3.2.30/api/render.zig @@ -1,794 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -813,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1148,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.30/api/scancode.zig b/official/release-3.2.30/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.2.30/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.30/api/sensor.zig b/official/release-3.2.30/api/sensor.zig index cc7fe67..f471675 100644 --- a/official/release-3.2.30/api/sensor.zig +++ b/official/release-3.2.30/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.30/api/stdinc.zig b/official/release-3.2.30/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.30/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.30/api/storage.zig b/official/release-3.2.30/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.30/api/storage.zig +++ b/official/release-3.2.30/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.30/api/surface.zig b/official/release-3.2.30/api/surface.zig index 1b61561..fc7f528 100644 --- a/official/release-3.2.30/api/surface.zig +++ b/official/release-3.2.30/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -87,6 +27,7 @@ pub const SurfaceFlags = packed struct(u32) { }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering }; @@ -99,230 +40,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.30/api/system.zig b/official/release-3.2.30/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.30/api/system.zig +++ b/official/release-3.2.30/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.30/api/time.zig b/official/release-3.2.30/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.30/api/time.zig +++ b/official/release-3.2.30/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.30/api/timer.zig b/official/release-3.2.30/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.30/api/timer.zig +++ b/official/release-3.2.30/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.30/api/touch.zig b/official/release-3.2.30/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.30/api/touch.zig +++ b/official/release-3.2.30/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.30/api/tray.zig b/official/release-3.2.30/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.30/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.30/api/version.zig b/official/release-3.2.30/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.30/api/version.zig +++ b/official/release-3.2.30/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.30/api/video.zig b/official/release-3.2.30/api/video.zig index 664b5d1..b59cc15 100644 --- a/official/release-3.2.30/api/video.zig +++ b/official/release-3.2.30/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.30/json/audio.json b/official/release-3.2.30/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.30/json/audio.json +++ b/official/release-3.2.30/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.30/json/blendmode.json b/official/release-3.2.30/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.30/json/blendmode.json +++ b/official/release-3.2.30/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.30/json/events.json b/official/release-3.2.30/json/events.json index 2698065..916ce18 100644 --- a/official/release-3.2.30/json/events.json +++ b/official/release-3.2.30/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1093,6 +1137,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.30/json/filesystem.json b/official/release-3.2.30/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.30/json/filesystem.json +++ b/official/release-3.2.30/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.30/json/gamepad.json b/official/release-3.2.30/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.30/json/gamepad.json +++ b/official/release-3.2.30/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.30/json/gpu.json b/official/release-3.2.30/json/gpu.json index 2bc908a..e981357 100644 --- a/official/release-3.2.30/json/gpu.json +++ b/official/release-3.2.30/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.30/json/guid.json b/official/release-3.2.30/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.30/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/haptic.json b/official/release-3.2.30/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.30/json/haptic.json +++ b/official/release-3.2.30/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.30/json/iostream.json b/official/release-3.2.30/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.30/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/joystick.json b/official/release-3.2.30/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.30/json/joystick.json +++ b/official/release-3.2.30/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.30/json/keyboard.json b/official/release-3.2.30/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.30/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/opengl.json b/official/release-3.2.30/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.30/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/pen.json b/official/release-3.2.30/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.30/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/pixels.json b/official/release-3.2.30/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.30/json/pixels.json +++ b/official/release-3.2.30/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.30/json/power.json b/official/release-3.2.30/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.30/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/process.json b/official/release-3.2.30/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.30/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/scancode.json b/official/release-3.2.30/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.2.30/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/surface.json b/official/release-3.2.30/json/surface.json index 4d48dda..228b300 100644 --- a/official/release-3.2.30/json/surface.json +++ b/official/release-3.2.30/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" diff --git a/official/release-3.2.30/json/system.json b/official/release-3.2.30/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.30/json/system.json +++ b/official/release-3.2.30/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.30/json/touch.json b/official/release-3.2.30/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.30/json/touch.json +++ b/official/release-3.2.30/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.30/json/tray.json b/official/release-3.2.30/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.30/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.30/json/video.json b/official/release-3.2.30/json/video.json index d2761bb..9121bf9 100644 --- a/official/release-3.2.30/json/video.json +++ b/official/release-3.2.30/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.4/api/audio.zig b/official/release-3.2.4/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.4/api/audio.zig +++ b/official/release-3.2.4/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.4/api/blendmode.zig b/official/release-3.2.4/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.4/api/blendmode.zig +++ b/official/release-3.2.4/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.4/api/c.zig b/official/release-3.2.4/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.4/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.4/api/camera.zig b/official/release-3.2.4/api/camera.zig index 5d16142..7a9ccd3 100644 --- a/official/release-3.2.4/api/camera.zig +++ b/official/release-3.2.4/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -106,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -119,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.4/api/clipboard.zig b/official/release-3.2.4/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.4/api/clipboard.zig +++ b/official/release-3.2.4/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.4/api/dialog.zig b/official/release-3.2.4/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.4/api/dialog.zig +++ b/official/release-3.2.4/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.4/api/error.zig b/official/release-3.2.4/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.4/api/error.zig +++ b/official/release-3.2.4/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.4/api/events.zig b/official/release-3.2.4/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.4/api/events.zig +++ b/official/release-3.2.4/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.4/api/filesystem.zig b/official/release-3.2.4/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.4/api/filesystem.zig +++ b/official/release-3.2.4/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.4/api/gamepad.zig b/official/release-3.2.4/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.4/api/gamepad.zig +++ b/official/release-3.2.4/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.4/api/gpu.zig b/official/release-3.2.4/api/gpu.zig index bc538dd..eaf88a1 100644 --- a/official/release-3.2.4/api/gpu.zig +++ b/official/release-3.2.4/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.4/api/guid.zig b/official/release-3.2.4/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.4/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.4/api/haptic.zig b/official/release-3.2.4/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.4/api/haptic.zig +++ b/official/release-3.2.4/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.4/api/hints.zig b/official/release-3.2.4/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.4/api/hints.zig +++ b/official/release-3.2.4/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.4/api/init.zig b/official/release-3.2.4/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.4/api/init.zig +++ b/official/release-3.2.4/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.4/api/iostream.zig b/official/release-3.2.4/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.4/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.4/api/joystick.zig b/official/release-3.2.4/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.4/api/joystick.zig +++ b/official/release-3.2.4/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.4/api/keyboard.zig b/official/release-3.2.4/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.4/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.4/api/keycode.zig b/official/release-3.2.4/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.4/api/keycode.zig +++ b/official/release-3.2.4/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.4/api/loadso.zig b/official/release-3.2.4/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.4/api/loadso.zig +++ b/official/release-3.2.4/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.4/api/messagebox.zig b/official/release-3.2.4/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.4/api/messagebox.zig +++ b/official/release-3.2.4/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.4/api/misc.zig b/official/release-3.2.4/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.4/api/misc.zig +++ b/official/release-3.2.4/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.4/api/mouse.zig b/official/release-3.2.4/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.4/api/mouse.zig +++ b/official/release-3.2.4/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.4/api/opengl.zig b/official/release-3.2.4/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.4/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.4/api/pen.zig b/official/release-3.2.4/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.4/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.4/api/pixels.zig b/official/release-3.2.4/api/pixels.zig index 2ce745b..f85c71f 100644 --- a/official/release-3.2.4/api/pixels.zig +++ b/official/release-3.2.4/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -67,15 +121,33 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -86,14 +158,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -102,51 +180,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -169,7 +241,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +266,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.4/api/power.zig b/official/release-3.2.4/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.4/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.4/api/process.zig b/official/release-3.2.4/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.4/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.4/api/properties.zig b/official/release-3.2.4/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.4/api/properties.zig +++ b/official/release-3.2.4/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.4/api/rect.zig b/official/release-3.2.4/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.4/api/rect.zig +++ b/official/release-3.2.4/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.4/api/render.zig b/official/release-3.2.4/api/render.zig index aaad785..0c57be7 100644 --- a/official/release-3.2.4/api/render.zig +++ b/official/release-3.2.4/api/render.zig @@ -1,791 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -810,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1145,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.4/api/scancode.zig b/official/release-3.2.4/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.4/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.4/api/sensor.zig b/official/release-3.2.4/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.4/api/sensor.zig +++ b/official/release-3.2.4/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.4/api/stdinc.zig b/official/release-3.2.4/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.4/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.4/api/storage.zig b/official/release-3.2.4/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.4/api/storage.zig +++ b/official/release-3.2.4/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.4/api/surface.zig b/official/release-3.2.4/api/surface.zig index b719a7a..f352ebb 100644 --- a/official/release-3.2.4/api/surface.zig +++ b/official/release-3.2.4/api/surface.zig @@ -1,78 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -98,230 +39,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.4/api/system.zig b/official/release-3.2.4/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.4/api/system.zig +++ b/official/release-3.2.4/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.4/api/time.zig b/official/release-3.2.4/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.4/api/time.zig +++ b/official/release-3.2.4/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.4/api/timer.zig b/official/release-3.2.4/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.4/api/timer.zig +++ b/official/release-3.2.4/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.4/api/touch.zig b/official/release-3.2.4/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.4/api/touch.zig +++ b/official/release-3.2.4/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.4/api/tray.zig b/official/release-3.2.4/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.4/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.4/api/version.zig b/official/release-3.2.4/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.4/api/version.zig +++ b/official/release-3.2.4/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.4/api/video.zig b/official/release-3.2.4/api/video.zig index 9125b0e..e43f76c 100644 --- a/official/release-3.2.4/api/video.zig +++ b/official/release-3.2.4/api/video.zig @@ -1,35 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -60,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -351,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -367,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -435,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -455,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -570,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -601,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.4/json/audio.json b/official/release-3.2.4/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.4/json/audio.json +++ b/official/release-3.2.4/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.4/json/blendmode.json b/official/release-3.2.4/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.4/json/blendmode.json +++ b/official/release-3.2.4/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.4/json/events.json b/official/release-3.2.4/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.4/json/events.json +++ b/official/release-3.2.4/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.4/json/filesystem.json b/official/release-3.2.4/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.4/json/filesystem.json +++ b/official/release-3.2.4/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.4/json/gamepad.json b/official/release-3.2.4/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.4/json/gamepad.json +++ b/official/release-3.2.4/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.4/json/gpu.json b/official/release-3.2.4/json/gpu.json index b1de6d6..a63962c 100644 --- a/official/release-3.2.4/json/gpu.json +++ b/official/release-3.2.4/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.4/json/guid.json b/official/release-3.2.4/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.4/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/haptic.json b/official/release-3.2.4/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.4/json/haptic.json +++ b/official/release-3.2.4/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.4/json/iostream.json b/official/release-3.2.4/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.4/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/joystick.json b/official/release-3.2.4/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.4/json/joystick.json +++ b/official/release-3.2.4/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.4/json/keyboard.json b/official/release-3.2.4/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.4/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/opengl.json b/official/release-3.2.4/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.4/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/pen.json b/official/release-3.2.4/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.4/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/pixels.json b/official/release-3.2.4/json/pixels.json index 3767023..da971fa 100644 --- a/official/release-3.2.4/json/pixels.json +++ b/official/release-3.2.4/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -200,16 +420,65 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -217,18 +486,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -278,17 +556,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -309,6 +599,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -348,17 +650,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -379,6 +693,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -394,10 +712,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -421,71 +751,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -496,12 +798,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -512,9 +808,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.4/json/power.json b/official/release-3.2.4/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.4/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/process.json b/official/release-3.2.4/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.4/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/scancode.json b/official/release-3.2.4/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.4/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/system.json b/official/release-3.2.4/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.4/json/system.json +++ b/official/release-3.2.4/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.4/json/touch.json b/official/release-3.2.4/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.4/json/touch.json +++ b/official/release-3.2.4/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.4/json/tray.json b/official/release-3.2.4/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.4/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.4/json/video.json b/official/release-3.2.4/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.4/json/video.json +++ b/official/release-3.2.4/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.6/api/audio.zig b/official/release-3.2.6/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.6/api/audio.zig +++ b/official/release-3.2.6/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.6/api/blendmode.zig b/official/release-3.2.6/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.6/api/blendmode.zig +++ b/official/release-3.2.6/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.6/api/c.zig b/official/release-3.2.6/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.6/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.6/api/camera.zig b/official/release-3.2.6/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.6/api/camera.zig +++ b/official/release-3.2.6/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.6/api/clipboard.zig b/official/release-3.2.6/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.6/api/clipboard.zig +++ b/official/release-3.2.6/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.6/api/dialog.zig b/official/release-3.2.6/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.6/api/dialog.zig +++ b/official/release-3.2.6/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.6/api/error.zig b/official/release-3.2.6/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.6/api/error.zig +++ b/official/release-3.2.6/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.6/api/events.zig b/official/release-3.2.6/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.6/api/events.zig +++ b/official/release-3.2.6/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.6/api/filesystem.zig b/official/release-3.2.6/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.6/api/filesystem.zig +++ b/official/release-3.2.6/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.6/api/gamepad.zig b/official/release-3.2.6/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.6/api/gamepad.zig +++ b/official/release-3.2.6/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.6/api/gpu.zig b/official/release-3.2.6/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.6/api/gpu.zig +++ b/official/release-3.2.6/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.6/api/guid.zig b/official/release-3.2.6/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.6/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.6/api/haptic.zig b/official/release-3.2.6/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.6/api/haptic.zig +++ b/official/release-3.2.6/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.6/api/hints.zig b/official/release-3.2.6/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.6/api/hints.zig +++ b/official/release-3.2.6/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.6/api/init.zig b/official/release-3.2.6/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.6/api/init.zig +++ b/official/release-3.2.6/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.6/api/iostream.zig b/official/release-3.2.6/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.6/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.6/api/joystick.zig b/official/release-3.2.6/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.6/api/joystick.zig +++ b/official/release-3.2.6/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.6/api/keyboard.zig b/official/release-3.2.6/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.6/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.6/api/keycode.zig b/official/release-3.2.6/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.6/api/keycode.zig +++ b/official/release-3.2.6/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.6/api/loadso.zig b/official/release-3.2.6/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.6/api/loadso.zig +++ b/official/release-3.2.6/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.6/api/messagebox.zig b/official/release-3.2.6/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.6/api/messagebox.zig +++ b/official/release-3.2.6/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.6/api/misc.zig b/official/release-3.2.6/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.6/api/misc.zig +++ b/official/release-3.2.6/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.6/api/mouse.zig b/official/release-3.2.6/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.6/api/mouse.zig +++ b/official/release-3.2.6/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.6/api/opengl.zig b/official/release-3.2.6/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.6/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.6/api/pen.zig b/official/release-3.2.6/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.6/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.6/api/pixels.zig b/official/release-3.2.6/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.6/api/pixels.zig +++ b/official/release-3.2.6/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.6/api/power.zig b/official/release-3.2.6/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.6/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.6/api/process.zig b/official/release-3.2.6/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.6/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.6/api/properties.zig b/official/release-3.2.6/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.6/api/properties.zig +++ b/official/release-3.2.6/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.6/api/rect.zig b/official/release-3.2.6/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.6/api/rect.zig +++ b/official/release-3.2.6/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.6/api/render.zig b/official/release-3.2.6/api/render.zig index 13eefa3..0c57be7 100644 --- a/official/release-3.2.6/api/render.zig +++ b/official/release-3.2.6/api/render.zig @@ -1,792 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -811,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1146,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.6/api/scancode.zig b/official/release-3.2.6/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.6/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.6/api/sensor.zig b/official/release-3.2.6/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.6/api/sensor.zig +++ b/official/release-3.2.6/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.6/api/stdinc.zig b/official/release-3.2.6/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.6/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.6/api/storage.zig b/official/release-3.2.6/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.6/api/storage.zig +++ b/official/release-3.2.6/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.6/api/surface.zig b/official/release-3.2.6/api/surface.zig index 1b61561..f352ebb 100644 --- a/official/release-3.2.6/api/surface.zig +++ b/official/release-3.2.6/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -99,230 +39,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.6/api/system.zig b/official/release-3.2.6/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.6/api/system.zig +++ b/official/release-3.2.6/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.6/api/time.zig b/official/release-3.2.6/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.6/api/time.zig +++ b/official/release-3.2.6/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.6/api/timer.zig b/official/release-3.2.6/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.6/api/timer.zig +++ b/official/release-3.2.6/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.6/api/touch.zig b/official/release-3.2.6/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.6/api/touch.zig +++ b/official/release-3.2.6/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.6/api/tray.zig b/official/release-3.2.6/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.6/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.6/api/version.zig b/official/release-3.2.6/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.6/api/version.zig +++ b/official/release-3.2.6/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.6/api/video.zig b/official/release-3.2.6/api/video.zig index 9fa1e06..e43f76c 100644 --- a/official/release-3.2.6/api/video.zig +++ b/official/release-3.2.6/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.6/json/audio.json b/official/release-3.2.6/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.6/json/audio.json +++ b/official/release-3.2.6/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.6/json/blendmode.json b/official/release-3.2.6/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.6/json/blendmode.json +++ b/official/release-3.2.6/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.6/json/events.json b/official/release-3.2.6/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.6/json/events.json +++ b/official/release-3.2.6/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.6/json/filesystem.json b/official/release-3.2.6/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.6/json/filesystem.json +++ b/official/release-3.2.6/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.6/json/gamepad.json b/official/release-3.2.6/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.6/json/gamepad.json +++ b/official/release-3.2.6/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.6/json/gpu.json b/official/release-3.2.6/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.6/json/gpu.json +++ b/official/release-3.2.6/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.6/json/guid.json b/official/release-3.2.6/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.6/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/haptic.json b/official/release-3.2.6/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.6/json/haptic.json +++ b/official/release-3.2.6/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.6/json/iostream.json b/official/release-3.2.6/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.6/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/joystick.json b/official/release-3.2.6/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.6/json/joystick.json +++ b/official/release-3.2.6/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.6/json/keyboard.json b/official/release-3.2.6/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.6/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/opengl.json b/official/release-3.2.6/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.6/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/pen.json b/official/release-3.2.6/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.6/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/pixels.json b/official/release-3.2.6/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.6/json/pixels.json +++ b/official/release-3.2.6/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.6/json/power.json b/official/release-3.2.6/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.6/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/process.json b/official/release-3.2.6/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.6/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/scancode.json b/official/release-3.2.6/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.6/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/system.json b/official/release-3.2.6/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.6/json/system.json +++ b/official/release-3.2.6/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.6/json/touch.json b/official/release-3.2.6/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.6/json/touch.json +++ b/official/release-3.2.6/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.6/json/tray.json b/official/release-3.2.6/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.6/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.6/json/video.json b/official/release-3.2.6/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.6/json/video.json +++ b/official/release-3.2.6/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.2.8/api/audio.zig b/official/release-3.2.8/api/audio.zig index 97af535..7a7be11 100644 --- a/official/release-3.2.8/api/audio.zig +++ b/official/release-3.2.8/api/audio.zig @@ -1,13 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); - } -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format @@ -19,6 +16,10 @@ pub const AudioFormat = enum(c_int) { audioS32be = 0x9020, //As above, but big-endian byte order audioF32le = 0x8120, //32-bit floating point samples audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -31,111 +32,111 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(@ptrCast(audiostream)); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { - return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(audiostream), @ptrCast(src_spec), @ptrCast(dst_spec))); + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(audiostream), ratio)); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(audiostream), gain)); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(audiostream), @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(audiostream), chmap, count)); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(@ptrCast(audiostream)); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_FlushAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ClearAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(audiostream))); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(audiostream))); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_LockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(audiostream))); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(audiostream), callback, userdata)); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(@ptrCast(audiostream)); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } }; @@ -151,28 +152,28 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioPlaybackDevices(@ptrCast(count))); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return @ptrCast(c.SDL_GetAudioRecordingDevices(@ptrCast(count))); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(spec), @ptrCast(sample_frames))); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { @@ -207,26 +208,26 @@ pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]?*const AudioStream, num_streams: c_int) bool { - return @bitCast(c.SDL_BindAudioStreams(devid, streams, num_streams)); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(stream))); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]?*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { - return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return @ptrCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata)); + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; @@ -235,22 +236,26 @@ pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostm return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return @bitCast(c.SDL_LoadWAV(path, @ptrCast(spec), audio_buf, @ptrCast(audio_len))); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return @bitCast(c.SDL_MixAudio(dst, src, @bitCast(format), len, volume)); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len))); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } diff --git a/official/release-3.2.8/api/blendmode.zig b/official/release-3.2.8/api/blendmode.zig index 5428b63..2a64eca 100644 --- a/official/release-3.2.8/api/blendmode.zig +++ b/official/release-3.2.8/api/blendmode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { @@ -8,7 +7,7 @@ pub const BlendOperation = enum(c_int) { blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum = 0x5, + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { @@ -21,9 +20,9 @@ pub const BlendFactor = enum(c_int) { blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha = 0xA, + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.2.8/api/c.zig b/official/release-3.2.8/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.2.8/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.2.8/api/camera.zig b/official/release-3.2.8/api/camera.zig index ba8fe7b..7a9ccd3 100644 --- a/official/release-3.2.8/api/camera.zig +++ b/official/release-3.2.8/api/camera.zig @@ -1,82 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) c_int { - return c.SDL_GetCameraPermissionState(@ptrCast(camera)); + return c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(@ptrCast(camera)); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(@ptrCast(camera)); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return @bitCast(c.SDL_GetCameraFormat(@ptrCast(camera), @ptrCast(spec))); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return @ptrCast(c.SDL_AcquireCameraFrame(@ptrCast(camera), @ptrCast(timestampNS))); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(@ptrCast(camera), @ptrCast(frame)); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(@ptrCast(camera)); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -107,12 +68,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -120,9 +81,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { - return @ptrCast(c.SDL_OpenCamera(instance_id, @ptrCast(spec))); + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.2.8/api/clipboard.zig b/official/release-3.2.8/api/clipboard.zig index e8cb2cd..6fe8270 100644 --- a/official/release-3.2.8/api/clipboard.zig +++ b/official/release-3.2.8/api/clipboard.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { return @bitCast(c.SDL_SetClipboardText(text)); } @@ -37,14 +36,14 @@ pub inline fn clearClipboardData() bool { return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.2.8/api/dialog.zig b/official/release-3.2.8/api/dialog.zig index e046fbe..5f94fcf 100644 --- a/official/release-3.2.8/api/dialog.zig +++ b/official/release-3.2.8/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -13,15 +14,15 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(window), @ptrCast(filters), nfilters, default_location); + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(window), default_location, @bitCast(allow_many)); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.2.8/api/error.zig b/official/release-3.2.8/api/error.zig index 5fce715..9752b22 100644 --- a/official/release-3.2.8/api/error.zig +++ b/official/release-3.2.8/api/error.zig @@ -1,5 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { return @bitCast(c.SDL_OutOfMemory()); diff --git a/official/release-3.2.8/api/events.zig b/official/release-3.2.8/api/events.zig index e6ece5d..d1227c3 100644 --- a/official/release-3.2.8/api/events.zig +++ b/official/release-3.2.8/api/events.zig @@ -1,167 +1,48 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { eventFirst = 0, //Unused (do not remove) eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed eventDisplayOrientation = 0x151, //Display orientation has changed to data1 @@ -194,13 +75,13 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates @@ -231,6 +112,7 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, @@ -259,10 +141,19 @@ pub const EventType = enum(c_int) { eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayContentScaleChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -325,7 +216,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -421,6 +312,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -700,7 +592,7 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(@ptrCast(events), numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { @@ -720,19 +612,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PollEvent(@ptrCast(event))); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return @bitCast(c.SDL_WaitEvent(@ptrCast(event))); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(event), timeoutMS)); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return @bitCast(c.SDL_PushEvent(@ptrCast(event))); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -742,7 +634,7 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return @bitCast(c.SDL_GetEventFilter(@ptrCast(filter), userdata)); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { @@ -770,5 +662,5 @@ pub inline fn registerEvents(numevents: c_int) u32 { } pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { - return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } diff --git a/official/release-3.2.8/api/filesystem.zig b/official/release-3.2.8/api/filesystem.zig index 4b1a383..48f8e71 100644 --- a/official/release-3.2.8/api/filesystem.zig +++ b/official/release-3.2.8/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -60,7 +61,7 @@ pub inline fn createDirectory(path: [*c]const u8) bool { pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; @@ -82,11 +83,11 @@ pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(info))); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.2.8/api/gamepad.zig b/official/release-3.2.8/api/gamepad.zig index 5aa8b49..1f8f790 100644 --- a/official/release-3.2.8/api/gamepad.zig +++ b/official/release-3.2.8/api/gamepad.zig @@ -1,211 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(@ptrCast(iostream), @bitCast(closeio)); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(@ptrCast(gamepad)); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(@ptrCast(gamepad)); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(@ptrCast(gamepad)); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(@ptrCast(gamepad)); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(@ptrCast(gamepad)); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(@ptrCast(gamepad))); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(@ptrCast(gamepad)); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(gamepad), player_index)); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(@ptrCast(gamepad)); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(@ptrCast(gamepad)); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(@ptrCast(gamepad)); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(@ptrCast(gamepad)); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(@ptrCast(gamepad)); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(@ptrCast(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(@ptrCast(gamepad), @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return @bitCast(c.SDL_GamepadConnected(@ptrCast(gamepad))); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return @ptrCast(c.SDL_GetGamepadJoystick(@ptrCast(gamepad))); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c]?*GamepadBinding { - return c.SDL_GetGamepadBindings(@ptrCast(gamepad), @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(gamepad), axis)); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GamepadHasButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return @bitCast(c.SDL_GetGamepadButton(@ptrCast(gamepad), button)); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(@ptrCast(gamepad), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(@ptrCast(gamepad)); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(gamepad), touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(gamepad), touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure))); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type), @bitCast(enabled))); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(gamepad), @intFromEnum(_type))); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(@ptrCast(gamepad), @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(gamepad), @intFromEnum(_type), @ptrCast(data), num_values)); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepad(@ptrCast(gamepad), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(gamepad), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetGamepadLED(@ptrCast(gamepad), red, green, blue)); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(gamepad), data, size)); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(@ptrCast(gamepad)); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(gamepad), button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(gamepad), axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -220,6 +194,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -262,6 +237,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -272,6 +248,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -283,6 +260,10 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } @@ -291,12 +272,12 @@ pub inline fn reloadGamepadMappings() bool { return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { @@ -307,8 +288,8 @@ pub inline fn hasGamepad() bool { return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetGamepads(@ptrCast(count))); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { @@ -328,7 +309,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -344,11 +325,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -356,15 +337,15 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_OpenGamepad(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return @ptrCast(c.SDL_GetGamepadFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { @@ -380,29 +361,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.2.8/api/gpu.zig b/official/release-3.2.8/api/gpu.zig index c5376d7..eed4925 100644 --- a/official/release-3.2.8/api/gpu.zig +++ b/official/release-3.2.8/api/gpu.zig @@ -1,181 +1,168 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(@ptrCast(gpudevice)); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(@ptrCast(gpudevice)); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return @ptrCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { - return @ptrCast(c.SDL_CreateGPUSampler(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { - return @ptrCast(c.SDL_CreateGPUShader(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { - return @ptrCast(c.SDL_CreateGPUTexture(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { - return @ptrCast(c.SDL_CreateGPUBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return @ptrCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(createinfo))); + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(@ptrCast(gpudevice), @ptrCast(buffer), text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(@ptrCast(gpudevice), @ptrCast(texture), text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(@ptrCast(gpudevice), @ptrCast(texture)); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(@ptrCast(gpudevice), @ptrCast(sampler)); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(@ptrCast(gpudevice), @ptrCast(buffer)); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(compute_pipeline)); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(@ptrCast(gpudevice), @ptrCast(shader)); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(gpudevice), @ptrCast(graphics_pipeline)); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return @ptrCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(gpudevice))); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer), @bitCast(cycle)); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(@ptrCast(gpudevice), @ptrCast(transfer_buffer)); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition)); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(gpudevice), @ptrCast(window), @intFromEnum(present_mode))); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(gpudevice), @ptrCast(window)); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(gpudevice), @ptrCast(window), swapchain_composition, @intFromEnum(present_mode))); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(gpudevice), allowed_frames_in_flight)); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(gpudevice), @ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(gpudevice), @ptrCast(window))); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(gpudevice))); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]?*const GPUFence, num_fences: u32) bool { - return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(gpudevice), @bitCast(wait_all), fences, num_fences)); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return @bitCast(c.SDL_QueryGPUFence(@ptrCast(gpudevice), @ptrCast(fence))); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(@ptrCast(gpudevice), @ptrCast(fence)); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(gpudevice), @bitCast(format), @intFromEnum(_type), @bitCast(usage))); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(gpudevice), @bitCast(format), sample_count)); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(@ptrCast(gpudevice)); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(@ptrCast(gpudevice)); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -195,201 +182,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(@ptrCast(gpucommandbuffer), text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(@ptrCast(gpucommandbuffer), name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(@ptrCast(gpucommandbuffer)); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(@ptrCast(gpucommandbuffer), slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return @ptrCast(c.SDL_BeginGPURenderPass(@ptrCast(gpucommandbuffer), @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info))); + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return @ptrCast(c.SDL_BeginGPUComputePass(@ptrCast(gpucommandbuffer), @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings)); + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return @ptrCast(c.SDL_BeginGPUCopyPass(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(texture)); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(@ptrCast(gpucommandbuffer), @ptrCast(info)); + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(gpucommandbuffer), @ptrCast(window), swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height))); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return @ptrCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(gpucommandbuffer))); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(gpucommandbuffer))); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(@ptrCast(gpurenderpass), @ptrCast(graphics_pipeline)); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { - return c.SDL_SetGPUViewport(@ptrCast(gpurenderpass), @ptrCast(viewport)); + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { - return c.SDL_SetGPUScissor(@ptrCast(gpurenderpass), @ptrCast(scissor)); + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(@ptrCast(gpurenderpass), blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(@ptrCast(gpurenderpass), reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(@ptrCast(gpurenderpass), first_slot, @ptrCast(bindings), num_bindings); + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(@ptrCast(gpurenderpass), @ptrCast(binding), index_element_size); + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(@ptrCast(gpurenderpass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(gpurenderpass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(gpurenderpass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(gpurenderpass), num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(@ptrCast(gpurenderpass), num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(gpurenderpass), @ptrCast(buffer), offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(@ptrCast(gpurenderpass)); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(@ptrCast(gpucomputepass), @ptrCast(compute_pipeline)); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(@ptrCast(gpucomputepass), first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]?*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(@ptrCast(gpucomputepass), first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]?*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(gpucomputepass), first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(@ptrCast(gpucomputepass), groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(@ptrCast(gpucomputepass), @ptrCast(buffer), offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(@ptrCast(gpucomputepass)); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), @bitCast(cycle)); + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), w, h, d, @bitCast(cycle)); + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination), size, @bitCast(cycle)); + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(@ptrCast(gpucopypass), @ptrCast(source), @ptrCast(destination)); + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(@ptrCast(gpucopypass)); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -688,7 +675,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -705,7 +692,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -866,9 +853,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: ?*const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: ?*const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -972,7 +959,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: ?*const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1089,11 +1076,11 @@ pub inline fn gpuSupportsProperties(props: PropertiesID) bool { } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub inline fn getNumGPUDrivers() c_int { @@ -1105,9 +1092,9 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } diff --git a/official/release-3.2.8/api/guid.zig b/official/release-3.2.8/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.2.8/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.2.8/api/haptic.zig b/official/release-3.2.8/api/haptic.zig index 5f82803..2488e5c 100644 --- a/official/release-3.2.8/api/haptic.zig +++ b/official/release-3.2.8/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(joystick))); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromJoystick(@ptrCast(joystick))); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(@ptrCast(haptic)); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(@ptrCast(haptic)); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(@ptrCast(haptic)); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(haptic)); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(@ptrCast(haptic)); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(@ptrCast(haptic)); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { - return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { - return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { - return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { - return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { - return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { - return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return @bitCast(c.SDL_SetHapticGain(@ptrCast(haptic), gain)); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(haptic), autocenter)); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_PauseHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return @bitCast(c.SDL_ResumeHaptic(@ptrCast(haptic))); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticEffects(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(haptic))); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_InitHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(haptic), strength, length)); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return @bitCast(c.SDL_StopHapticRumble(@ptrCast(haptic))); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -125,6 +118,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -141,6 +135,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: u16, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -186,7 +181,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -205,8 +200,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return @ptrCast(c.SDL_GetHaptics(@ptrCast(count))); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -214,11 +209,11 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_OpenHaptic(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return @ptrCast(c.SDL_GetHapticFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { @@ -226,5 +221,13 @@ pub inline fn isMouseHaptic() bool { } pub inline fn openHapticFromMouse() ?*Haptic { - return @ptrCast(c.SDL_OpenHapticFromMouse()); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.2.8/api/hints.zig b/official/release-3.2.8/api/hints.zig index 299b839..862a596 100644 --- a/official/release-3.2.8/api/hints.zig +++ b/official/release-3.2.8/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,7 +7,7 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return @bitCast(c.SDL_SetHintWithPriority(name, value, priority)); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { diff --git a/official/release-3.2.8/api/init.zig b/official/release-3.2.8/api/init.zig index b568c23..0be8c92 100644 --- a/official/release-3.2.8/api/init.zig +++ b/official/release-3.2.8/api/init.zig @@ -1,16 +1,18 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, pub const None = InitFlags{}; diff --git a/official/release-3.2.8/api/iostream.zig b/official/release-3.2.8/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.2.8/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.2.8/api/joystick.zig b/official/release-3.2.8/api/joystick.zig index 4fd3cd1..a6cee42 100644 --- a/official/release-3.2.8/api/joystick.zig +++ b/official/release-3.2.8/api/joystick.zig @@ -1,175 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid = -1, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(joystick), axis, value)); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(joystick), ball, xrel, yrel)); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(joystick), button, @bitCast(down))); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(joystick), hat, value)); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(joystick), touchpad, finger, @bitCast(down), x, y, pressure)); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(joystick), @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values)); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(@ptrCast(joystick)); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(@ptrCast(joystick)); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(@ptrCast(joystick)); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(@ptrCast(joystick)); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(joystick), player_index)); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(@ptrCast(joystick)); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(@ptrCast(joystick)); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(@ptrCast(joystick)); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(@ptrCast(joystick)); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(@ptrCast(joystick)); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(@ptrCast(joystick))); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return @bitCast(c.SDL_JoystickConnected(@ptrCast(joystick))); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(@ptrCast(joystick)); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(@ptrCast(joystick)); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(@ptrCast(joystick)); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(@ptrCast(joystick)); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(@ptrCast(joystick)); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(@ptrCast(joystick), axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(joystick), axis, @ptrCast(state))); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return @bitCast(c.SDL_GetJoystickBall(@ptrCast(joystick), ball, @ptrCast(dx), @ptrCast(dy))); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(@ptrCast(joystick), hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return @bitCast(c.SDL_GetJoystickButton(@ptrCast(joystick), button)); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystick(@ptrCast(joystick), low_frequency_rumble, high_frequency_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(joystick), left_rumble, right_rumble, duration_ms)); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return @bitCast(c.SDL_SetJoystickLED(@ptrCast(joystick), red, green, blue)); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(joystick), data, size)); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(@ptrCast(joystick)); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(@ptrCast(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(@ptrCast(joystick), @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -190,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -207,8 +191,8 @@ pub inline fn hasJoystick() bool { return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return @ptrCast(c.SDL_GetJoysticks(@ptrCast(count))); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -224,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -240,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_OpenJoystick(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return @ptrCast(c.SDL_GetJoystickFromPlayerIndex(player_index)); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -278,22 +262,24 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: ?*const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: ?*const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { @@ -304,8 +290,8 @@ pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { diff --git a/official/release-3.2.8/api/keyboard.zig b/official/release-3.2.8/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.2.8/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.2.8/api/keycode.zig b/official/release-3.2.8/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.2.8/api/keycode.zig +++ b/official/release-3.2.8/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.2.8/api/loadso.zig b/official/release-3.2.8/api/loadso.zig index 3a056bd..aa318c0 100644 --- a/official/release-3.2.8/api/loadso.zig +++ b/official/release-3.2.8/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(@ptrCast(sharedobject), name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(@ptrCast(sharedobject)); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return @ptrCast(c.SDL_LoadObject(sofile)); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.2.8/api/messagebox.zig b/official/release-3.2.8/api/messagebox.zig index a7f2d2c..84c5f01 100644 --- a/official/release-3.2.8/api/messagebox.zig +++ b/official/release-3.2.8/api/messagebox.zig @@ -1,15 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, pub const None = MessageBoxFlags{}; @@ -55,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: ?*const MessageBoxButtonData, - colorScheme: ?*const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: *c_int) bool { - return @bitCast(c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid))); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(window))); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.2.8/api/misc.zig b/official/release-3.2.8/api/misc.zig index 189a0fa..c557052 100644 --- a/official/release-3.2.8/api/misc.zig +++ b/official/release-3.2.8/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.2.8/api/mouse.zig b/official/release-3.2.8/api/mouse.zig index d6faf4a..7e92f87 100644 --- a/official/release-3.2.8/api/mouse.zig +++ b/official/release-3.2.8/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(@ptrCast(window), x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(window), @bitCast(enabled))); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(window))); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateColorCursor(@ptrCast(surface), hot_x, hot_y)); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return @bitCast(c.SDL_SetCursor(@ptrCast(cursor))); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(@ptrCast(cursor)); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -78,8 +63,8 @@ pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return @ptrCast(c.SDL_GetMice(@ptrCast(count))); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -87,43 +72,59 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return @ptrCast(c.SDL_GetMouseFocus()); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return @ptrCast(c.SDL_CreateSystemCursor(id)); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return @ptrCast(c.SDL_GetCursor()); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return @ptrCast(c.SDL_GetDefaultCursor()); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { diff --git a/official/release-3.2.8/api/opengl.zig b/official/release-3.2.8/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.2.8/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.2.8/api/pen.zig b/official/release-3.2.8/api/pen.zig new file mode 100644 index 0000000..0434dff --- /dev/null +++ b/official/release-3.2.8/api/pen.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + rsvd: bool = false, + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; diff --git a/official/release-3.2.8/api/pixels.zig b/official/release-3.2.8/api/pixels.zig index 906ff2c..654e23c 100644 --- a/official/release-3.2.8/api/pixels.zig +++ b/official/release-3.2.8/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,6 +57,61 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) @@ -68,15 +122,33 @@ pub const PixelFormat = enum(c_int) { pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull = 2, + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M @@ -87,14 +159,20 @@ pub const ColorPrimaries = enum(c_int) { colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) @@ -103,51 +181,45 @@ pub const TransferCharacteristics = enum(c_int) { transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, matrixCoefficientsFcc = 4, //US FCC Title 47 matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { chromaLocationNone = 0, //RGB, no chroma sampling chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft = 3, + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified @@ -170,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -195,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return @bitCast(c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask))); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return @ptrCast(c.SDL_CreatePalette(ncolors)); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { - return @bitCast(c.SDL_SetPaletteColors(@ptrCast(palette), @ptrCast(colors), firstcolor, ncolors)); + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(@ptrCast(palette)); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } pub inline fn getRGB(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b); + return c.SDL_GetRGB(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } pub inline fn getRGBA(pixel: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a); + return c.SDL_GetRGBA(pixel, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.2.8/api/power.zig b/official/release-3.2.8/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.2.8/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.2.8/api/process.zig b/official/release-3.2.8/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.2.8/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.2.8/api/properties.zig b/official/release-3.2.8/api/properties.zig index 84fae79..5e15c59 100644 --- a/official/release-3.2.8/api/properties.zig +++ b/official/release-3.2.8/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -63,7 +62,7 @@ pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { diff --git a/official/release-3.2.8/api/rect.zig b/official/release-3.2.8/api/rect.zig index fcc1543..04d56b0 100644 --- a/official/release-3.2.8/api/rect.zig +++ b/official/release-3.2.8/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -26,41 +25,41 @@ pub const FRect = extern struct { }; pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { - return @bitCast(c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { - return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { - return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B))); + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), @ptrCast(result))); + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { - return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), @ptrCast(result))); + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2))); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.2.8/api/render.zig b/official/release-3.2.8/api/render.zig index 13eefa3..0c57be7 100644 --- a/official/release-3.2.8/api/render.zig +++ b/official/release-3.2.8/api/render.zig @@ -1,792 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return @ptrCast(c.SDL_CreateSoftwareRenderer(@ptrCast(surface))); - } -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering -}; - -pub const PropertiesID = u32; - -pub const BlendMode = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return @ptrCast(c.SDL_GetRenderer(@ptrCast(window))); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_DISPLAYEVENT_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst = 0, //Unused (do not remove) - eventQuit = 0x100, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation = 0x151, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventWindowShown = 0x202, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown = 0x300, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventMouseMotion = 0x400, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion = 0x600, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion = 0x650, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventClipboardUpdate = 0x900, //The clipboard or primary selection changed - eventDropFile = 0x1000, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded = 0x1100, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate = 0x1200, //A sensor was updated - eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded = 0x1400, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, - - pub const None = MouseButtonFlags{}; - pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); - pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - pad0: u24 = 0, - rsvd: bool = false, - - pub const None = PenInputFlags{}; -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError = -1, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash = 49, - scancodeNonushash = 50, - scancodeGrave = 53, - scancodeInsert = 73, - scancodeNumlockclear = 83, - scancodeNonusbackslash = 100, - scancodeApplication = 101, //windows contextual menu, compose - scancodePower = 102, - scancodeHelp = 117, //AL Integrated Help Center - scancodeMenu = 118, //Menu (show menu) - scancodeStop = 120, //AC Stop - scancodeAgain = 121, //AC Redo/Repeat - scancodeUndo = 122, //AC Undo - scancodeCut = 123, //AC Cut - scancodeCopy = 124, //AC Copy - scancodePaste = 125, //AC Paste - scancodeFind = 126, //AC Find - scancodeInternational1 = 135, - scancodeInternational3 = 137, //Yen - scancodeLang1 = 144, //Hangul/English toggle - scancodeLang2 = 145, //Hanja conversion - scancodeLang3 = 146, //Katakana - scancodeLang4 = 147, //Hiragana - scancodeLang5 = 148, //Zenkaku/Hankaku - scancodeLang6 = 149, //reserved - scancodeLang7 = 150, //reserved - scancodeLang8 = 151, //reserved - scancodeLang9 = 152, //reserved - scancodeAlterase = 153, //Erase-Eaze - scancodeCancel = 155, //AC Cancel - scancodeLalt = 226, //alt, option - scancodeLgui = 227, //windows, command (apple), meta - scancodeRalt = 230, //alt gr, option - scancodeRgui = 231, //windows, command (apple), meta - scancodeMode = 257, - scancodeSleep = 258, //Sleep - scancodeWake = 259, //Wake - scancodeChannelIncrement = 260, //Channel Increment - scancodeChannelDecrement = 261, //Channel Decrement - scancodeMediaPlay = 262, //Play - scancodeMediaPause = 263, //Pause - scancodeMediaRecord = 264, //Record - scancodeMediaFastForward = 265, //Fast Forward - scancodeMediaRewind = 266, //Rewind - scancodeMediaNextTrack = 267, //Next Track - scancodeMediaPreviousTrack = 268, //Previous Track - scancodeMediaStop = 269, //Stop - scancodeMediaEject = 270, //Eject - scancodeMediaPlayPause = 271, //Play / Pause - scancodeMediaSelect = 272, - scancodeAcNew = 273, //AC New - scancodeAcOpen = 274, //AC Open - scancodeAcClose = 275, //AC Close - scancodeAcExit = 276, //AC Exit - scancodeAcSave = 277, //AC Save - scancodeAcPrint = 278, //AC Print - scancodeAcProperties = 279, //AC Properties - scancodeAcSearch = 280, //AC Search - scancodeAcHome = 281, //AC Home - scancodeAcBack = 282, //AC Back - scancodeAcForward = 283, //AC Forward - scancodeAcStop = 284, //AC Stop - scancodeAcRefresh = 285, //AC Refresh - scancodeAcBookmarks = 286, //AC Bookmarks - scancodeSoftleft = 287, - scancodeSoftright = 288, - scancodeCall = 289, //Used for accepting phone calls. - scancodeEndcall = 290, //Used for rejecting phone calls. - scancodeReserved = 400, //400-500 reserved for dynamic keycodes - scancodeCount = 512, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const blendmode_api = @import("blendmode.zig"); +const video_api = @import("video.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const PixelFormat = pixels_api.PixelFormat; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const ScaleMode = surface_api.ScaleMode; +pub const PropertiesID = properties_api.PropertiesID; +pub const BlendMode = blendmode_api.BlendMode; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const Rect = rect_api.Rect; +pub const WindowFlags = video_api.WindowFlags; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -811,329 +116,329 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(@ptrCast(renderer)); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(@ptrCast(renderer)); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(renderer), @ptrCast(w), @ptrCast(h))); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return @ptrCast(c.SDL_CreateTexture(@ptrCast(renderer), @bitCast(format), access, w, h)); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return @ptrCast(c.SDL_CreateTextureFromSurface(@ptrCast(renderer), @ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return @ptrCast(c.SDL_CreateTextureWithProperties(@ptrCast(renderer), props)); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return @bitCast(c.SDL_SetRenderTarget(@ptrCast(renderer), @ptrCast(texture))); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return @ptrCast(c.SDL_GetRenderTarget(@ptrCast(renderer))); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(renderer), w, h, mode)); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(renderer), @ptrCast(w), @ptrCast(h), @ptrCast(mode))); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(renderer), window_x, window_y, @ptrCast(x), @ptrCast(y))); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(renderer), x, y, @ptrCast(window_x), @ptrCast(window_y))); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(renderer), @ptrCast(event))); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderViewport(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderViewportSet(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return @bitCast(c.SDL_SetRenderScale(@ptrCast(renderer), scaleX, scaleY)); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return @bitCast(c.SDL_GetRenderScale(@ptrCast(renderer), @ptrCast(scaleX), @ptrCast(scaleY))); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(renderer), r, g, b, a)); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(renderer), @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(renderer), scale)); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(renderer), @ptrCast(scale))); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(renderer), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(renderer), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderClear(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return @bitCast(c.SDL_RenderPoint(@ptrCast(renderer), x, y)); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderPoints(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return @bitCast(c.SDL_RenderLine(@ptrCast(renderer), x1, y1, x2, y2)); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { - return @bitCast(c.SDL_RenderLines(@ptrCast(renderer), @ptrCast(points), count)); + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderFillRect(@ptrCast(renderer), @ptrCast(rect))); + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { - return @bitCast(c.SDL_RenderFillRects(@ptrCast(renderer), @ptrCast(rects), count)); + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { - return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip))); + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @intCast(@backingInt(flip)))); } pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { - return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down))); + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { - return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { - return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return @bitCast(c.SDL_RenderPresent(@ptrCast(renderer))); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(@ptrCast(renderer)); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return @bitCast(c.SDL_FlushRenderer(@ptrCast(renderer))); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(@ptrCast(renderer)); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(renderer)); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(renderer), wait_stage_mask, wait_semaphore, signal_semaphore)); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return @bitCast(c.SDL_SetRenderVSync(@ptrCast(renderer), vsync)); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return @bitCast(c.SDL_GetRenderVSync(@ptrCast(renderer), @ptrCast(vsync))); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(@ptrCast(texture)); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return @ptrCast(c.SDL_GetRendererFromTexture(@ptrCast(texture))); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(texture), r, g, b)); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(texture), @ptrCast(r), @ptrCast(g), @ptrCast(b))); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(texture), alpha)); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(texture), @ptrCast(alpha))); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(texture), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(texture), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(texture), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(texture), @ptrCast(scaleMode))); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return @bitCast(c.SDL_UpdateTexture(@ptrCast(texture), @ptrCast(rect), pixels, pitch)); + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(texture), @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch)); + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return @bitCast(c.SDL_LockTexture(@ptrCast(texture), @ptrCast(rect), pixels, @ptrCast(pitch))); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { - return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(texture), @ptrCast(rect), surface)); + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(@ptrCast(texture)); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(@ptrCast(texture)); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1146,9 +451,21 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { } pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { - return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer)); + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return @ptrCast(c.SDL_CreateRendererWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } diff --git a/official/release-3.2.8/api/scancode.zig b/official/release-3.2.8/api/scancode.zig new file mode 100644 index 0000000..1a7412c --- /dev/null +++ b/official/release-3.2.8/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.2.8/api/sensor.zig b/official/release-3.2.8/api/sensor.zig index eeb5d7c..0fe98c9 100644 --- a/official/release-3.2.8/api/sensor.zig +++ b/official/release-3.2.8/api/sensor.zig @@ -1,35 +1,36 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(@ptrCast(sensor)); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(@ptrCast(sensor)); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(@ptrCast(sensor))); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(@ptrCast(sensor)); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(@ptrCast(sensor)); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return @bitCast(c.SDL_GetSensorData(@ptrCast(sensor), @ptrCast(data), num_values)); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(@ptrCast(sensor)); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; @@ -46,8 +47,8 @@ pub const SensorType = enum(c_int) { sensorGyroR, //Gyroscope for right Joy-Con controller }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return @ptrCast(c.SDL_GetSensors(@ptrCast(count))); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -55,7 +56,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -63,11 +64,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_OpenSensor(instance_id)); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return @ptrCast(c.SDL_GetSensorFromID(instance_id)); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.2.8/api/stdinc.zig b/official/release-3.2.8/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.2.8/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.2.8/api/storage.zig b/official/release-3.2.8/api/storage.zig index e54e948..702db88 100644 --- a/official/release-3.2.8/api/storage.zig +++ b/official/release-3.2.8/api/storage.zig @@ -1,116 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, - - pub const None = GlobFlags{}; -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return @bitCast(c.SDL_CloseStorage(@ptrCast(storage))); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return @bitCast(c.SDL_StorageReady(@ptrCast(storage))); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(storage), path, @ptrCast(length))); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return @bitCast(c.SDL_ReadStorageFile(@ptrCast(storage), path, destination, length)); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return @bitCast(c.SDL_WriteStorageFile(@ptrCast(storage), path, source, length)); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(storage), path)); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(storage), path, callback, userdata)); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(storage), path)); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_RenameStoragePath(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return @bitCast(c.SDL_CopyStorageFile(@ptrCast(storage), oldpath, newpath)); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(storage), path, @ptrCast(info))); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(@ptrCast(storage)); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(@ptrCast(storage), path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenTitleStorage(override, props)); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return @ptrCast(c.SDL_OpenUserStorage(org, app, props)); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return @ptrCast(c.SDL_OpenFileStorage(path)); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return @ptrCast(c.SDL_OpenStorage(@ptrCast(iface), userdata)); + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.2.8/api/surface.zig b/official/release-3.2.8/api/surface.zig index 1b61561..f352ebb 100644 --- a/official/release-3.2.8/api/surface.zig +++ b/official/release-3.2.8/api/surface.zig @@ -1,79 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - - pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -99,230 +39,234 @@ pub const FlipMode = enum(c_int) { pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(@ptrCast(surface)); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(@ptrCast(surface)); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(surface), colorspace)); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(@ptrCast(surface)); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_CreateSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(surface), @ptrCast(palette))); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return @ptrCast(c.SDL_GetSurfacePalette(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(surface), @ptrCast(image))); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c]?*Surface { - return c.SDL_GetSurfaceImages(@ptrCast(surface), @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(surface)); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return @bitCast(c.SDL_LockSurface(@ptrCast(surface))); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(@ptrCast(surface)); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(surface), @bitCast(enabled), key)); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(surface))); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(surface), @ptrCast(key))); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(surface), r, g, b)); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(surface), alpha)); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(surface), @intFromEnum(blendMode))); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(surface), @ptrCast(blendMode))); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(surface), @ptrCast(rect))); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(flip)))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return @ptrCast(c.SDL_ScaleSurface(@ptrCast(surface), width, height, @intFromEnum(scaleMode))); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_ConvertSurface(@ptrCast(surface), @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return @ptrCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(surface), @bitCast(format), @ptrCast(palette), colorspace, props)); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(surface), @bitCast(linear))); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_ClearSurface(@ptrCast(surface), r, g, b, a)); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(surface), @ptrCast(rect), color)); + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { - return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(surface), @ptrCast(rects), count, color)); + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(surface), @ptrCast(srcrect), scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { - return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(surface), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), @ptrCast(dst), @ptrCast(dstrect))); + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(@ptrCast(surface), r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(@ptrCast(surface), r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(surface), x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a))); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(surface), x, y, r, g, b, a)); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return @ptrCast(c.SDL_CreateSurface(width, height, @bitCast(format))); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadBMP(file)); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch)); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return @bitCast(c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, @bitCast(linear))); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.2.8/api/system.zig b/official/release-3.2.8/api/system.zig index adb1c4c..2972144 100644 --- a/official/release-3.2.8/api/system.zig +++ b/official/release-3.2.8/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(window), interval, callback, callbackParam)); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex))); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -41,6 +37,10 @@ pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { return c.SDL_SetiOSEventPump(@bitCast(enabled)); } @@ -108,6 +108,7 @@ pub inline fn isTV() bool { } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return @bitCast(c.SDL_GetGDKTaskQueue(outTaskQueue)); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return @bitCast(c.SDL_GetGDKDefaultUser(outUserHandle)); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.2.8/api/time.zig b/official/release-3.2.8/api/time.zig index 9e16646..4eff0c3 100644 --- a/official/release-3.2.8/api/time.zig +++ b/official/release-3.2.8/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -27,23 +28,23 @@ pub const TimeFormat = enum(c_int) { }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(dateFormat), @ptrCast(timeFormat))); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return @bitCast(c.SDL_GetCurrentTime(@ptrCast(ticks))); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(dt), @bitCast(localTime))); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { - return @bitCast(c.SDL_DateTimeToTime(@ptrCast(dt), @ptrCast(ticks))); + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.2.8/api/timer.zig b/official/release-3.2.8/api/timer.zig index 965e68d..72b8518 100644 --- a/official/release-3.2.8/api/timer.zig +++ b/official/release-3.2.8/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } diff --git a/official/release-3.2.8/api/touch.zig b/official/release-3.2.8/api/touch.zig index a4a5926..7c54650 100644 --- a/official/release-3.2.8/api/touch.zig +++ b/official/release-3.2.8/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return @ptrCast(c.SDL_GetTouchDevices(@ptrCast(count))); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c]?*Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.2.8/api/tray.zig b/official/release-3.2.8/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.2.8/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.2.8/api/version.zig b/official/release-3.2.8/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.2.8/api/version.zig +++ b/official/release-3.2.8/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.2.8/api/video.zig b/official/release-3.2.8/api/video.zig index 9fa1e06..e43f76c 100644 --- a/official/release-3.2.8/api/video.zig +++ b/official/release-3.2.8/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,272 +42,272 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(@ptrCast(window)); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(@ptrCast(window)); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(@ptrCast(window)); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { - return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(window), @ptrCast(mode))); + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(@ptrCast(window), @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(@ptrCast(window))); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreatePopupWindow(@ptrCast(window), offset_x, offset_y, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(@ptrCast(window)); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return @ptrCast(c.SDL_GetWindowParent(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(@ptrCast(window)); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return @bitCast(c.SDL_SetWindowTitle(@ptrCast(window), title)); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(@ptrCast(window)); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowIcon(@ptrCast(window), @ptrCast(icon))); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_SetWindowPosition(@ptrCast(window), x, y)); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return @bitCast(c.SDL_GetWindowPosition(@ptrCast(window), @ptrCast(x), @ptrCast(y))); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return @bitCast(c.SDL_SetWindowSize(@ptrCast(window), w, h)); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(window), min_aspect, max_aspect)); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(window), @ptrCast(min_aspect), @ptrCast(max_aspect))); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(window), @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right))); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(window), min_w, min_h)); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(window), max_w, max_h)); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(window), @ptrCast(w), @ptrCast(h))); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return @bitCast(c.SDL_SetWindowBordered(@ptrCast(window), @bitCast(bordered))); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return @bitCast(c.SDL_SetWindowResizable(@ptrCast(window), @bitCast(resizable))); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn showWindow(window: *Window) bool { - return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return @bitCast(c.SDL_HideWindow(@ptrCast(window))); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return @bitCast(c.SDL_RaiseWindow(@ptrCast(window))); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MaximizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return @bitCast(c.SDL_MinimizeWindow(@ptrCast(window))); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return @bitCast(c.SDL_RestoreWindow(@ptrCast(window))); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(window), @bitCast(fullscreen))); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return @bitCast(c.SDL_SyncWindow(@ptrCast(window))); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return @bitCast(c.SDL_WindowHasSurface(@ptrCast(window))); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return @ptrCast(c.SDL_GetWindowSurface(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(window), vsync)); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(window), @ptrCast(vsync))); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { - return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(window), @ptrCast(rects), numrects)); + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(window))); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(window), @bitCast(grabbed))); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(window))); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { - return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(window), @ptrCast(rect))); + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(@ptrCast(window))); + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(window), opacity)); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(@ptrCast(window)); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return @bitCast(c.SDL_SetWindowParent(@ptrCast(window), @ptrCast(parent))); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return @bitCast(c.SDL_SetWindowModal(@ptrCast(window), @bitCast(modal))); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(window), @bitCast(focusable))); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(window), x, y)); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(window), callback, callback_data)); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return @bitCast(c.SDL_SetWindowShape(@ptrCast(window), @ptrCast(shape))); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(@ptrCast(window)); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(@ptrCast(window)); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(window), context)); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(@ptrCast(window)); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(window))); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -352,11 +333,12 @@ pub const WindowFlags = packed struct(u64) { windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + pad0: u7 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u38 = 0, + pad1: u31 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -368,7 +350,7 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -436,11 +418,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return @ptrCast(c.SDL_GetDisplays(@ptrCast(count))); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -456,67 +438,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(rect))); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c]?*DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(closest))); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c]?*Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return @ptrCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags))); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return @ptrCast(c.SDL_CreateWindowWithProperties(props)); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return @ptrCast(c.SDL_GetWindowFromID(id)); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return @ptrCast(c.SDL_GetGrabbedWindow()); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -571,19 +553,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return @bitCast(c.SDL_GL_SetAttribute(attr, value)); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return @bitCast(c.SDL_GL_GetAttribute(attr, @ptrCast(value))); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return @ptrCast(c.SDL_GL_GetCurrentWindow()); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -602,10 +584,10 @@ pub inline fn gl_SetSwapInterval(interval: c_int) bool { return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return @bitCast(c.SDL_GL_GetSwapInterval(@ptrCast(interval))); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return @bitCast(c.SDL_GL_DestroyContext(context)); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.2.8/json/audio.json b/official/release-3.2.8/json/audio.json index a01869f..ffcb532 100644 --- a/official/release-3.2.8/json/audio.json +++ b/official/release-3.2.8/json/audio.json @@ -68,6 +68,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.2.8/json/blendmode.json b/official/release-3.2.8/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.2.8/json/blendmode.json +++ b/official/release-3.2.8/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.2.8/json/events.json b/official/release-3.2.8/json/events.json index acc1421..05b35df 100644 --- a/official/release-3.2.8/json/events.json +++ b/official/release-3.2.8/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -77,6 +83,14 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -171,12 +185,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -195,7 +218,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -320,6 +344,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -436,6 +464,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -449,6 +481,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1083,6 +1127,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.2.8/json/filesystem.json b/official/release-3.2.8/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.2.8/json/filesystem.json +++ b/official/release-3.2.8/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.2.8/json/gamepad.json b/official/release-3.2.8/json/gamepad.json index 0be43f0..7b87127 100644 --- a/official/release-3.2.8/json/gamepad.json +++ b/official/release-3.2.8/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -50,6 +54,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -183,6 +191,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -209,6 +221,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.2.8/json/gpu.json b/official/release-3.2.8/json/gpu.json index 95664ef..170f1aa 100644 --- a/official/release-3.2.8/json/gpu.json +++ b/official/release-3.2.8/json/gpu.json @@ -789,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -848,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, diff --git a/official/release-3.2.8/json/guid.json b/official/release-3.2.8/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.2.8/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/haptic.json b/official/release-3.2.8/json/haptic.json index 4689b58..27e1f06 100644 --- a/official/release-3.2.8/json/haptic.json +++ b/official/release-3.2.8/json/haptic.json @@ -93,6 +93,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -163,6 +167,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "Uint16" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.2.8/json/iostream.json b/official/release-3.2.8/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.2.8/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/joystick.json b/official/release-3.2.8/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.2.8/json/joystick.json +++ b/official/release-3.2.8/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.2.8/json/keyboard.json b/official/release-3.2.8/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.2.8/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/opengl.json b/official/release-3.2.8/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.2.8/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/pen.json b/official/release-3.2.8/json/pen.json new file mode 100644 index 0000000..31ddfc2 --- /dev/null +++ b/official/release-3.2.8/json/pen.json @@ -0,0 +1,97 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + } + ] + } + ], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/pixels.json b/official/release-3.2.8/json/pixels.json index 4122d6d..a7a3acc 100644 --- a/official/release-3.2.8/json/pixels.json +++ b/official/release-3.2.8/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.2.8/json/power.json b/official/release-3.2.8/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.2.8/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/process.json b/official/release-3.2.8/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.2.8/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/scancode.json b/official/release-3.2.8/json/scancode.json new file mode 100644 index 0000000..a1f28ed --- /dev/null +++ b/official/release-3.2.8/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/system.json b/official/release-3.2.8/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.2.8/json/system.json +++ b/official/release-3.2.8/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.2.8/json/touch.json b/official/release-3.2.8/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.2.8/json/touch.json +++ b/official/release-3.2.8/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.2.8/json/tray.json b/official/release-3.2.8/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.2.8/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.2.8/json/video.json b/official/release-3.2.8/json/video.json index a9e23a5..b713b22 100644 --- a/official/release-3.2.8/json/video.json +++ b/official/release-3.2.8/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, diff --git a/official/release-3.4.0/api/audio.zig b/official/release-3.4.0/api/audio.zig index bf241ae..e8689f8 100644 --- a/official/release-3.4.0/api/audio.zig +++ b/official/release-3.4.0/api/audio.zig @@ -1,25 +1,25 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); -pub const IOStream = opaque { - pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV_IO(iostream, closeio, spec, audio_buf, @ptrCast(audio_len)); - } - -}; - -pub const PropertiesID = u32; +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; pub const AudioFormat = enum(c_int) { - audioUnknown, //Unspecified audio format - audioU8, //Unsigned 8-bit samples - audioS8, //Signed 8-bit samples - audioS16le, //Signed 16-bit samples - audioS16be, //As above, but big-endian byte order - audioS32le, //32-bit integer samples - audioS32be, //As above, but big-endian byte order - audioF32le, //32-bit floating point samples - audioF32be, //As above, but big-endian byte order + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; }; pub const AudioDeviceID = u32; @@ -32,121 +32,120 @@ pub const AudioSpec = extern struct { pub const AudioStream = opaque { pub inline fn unbindAudioStream(audiostream: *AudioStream) void { - return c.SDL_UnbindAudioStream(audiostream); + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { - return c.SDL_GetAudioStreamDevice(audiostream); + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { - return c.SDL_GetAudioStreamProperties(audiostream); + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { - return c.SDL_GetAudioStreamFormat(audiostream, src_spec, dst_spec); + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } - pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: *const AudioSpec, dst_spec: *const AudioSpec) bool { - return c.SDL_SetAudioStreamFormat(audiostream, @ptrCast(src_spec), @ptrCast(dst_spec)); + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); } pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamFrequencyRatio(audiostream); + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { - return c.SDL_SetAudioStreamFrequencyRatio(audiostream, ratio); + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); } pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { - return c.SDL_GetAudioStreamGain(audiostream); + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); } pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { - return c.SDL_SetAudioStreamGain(audiostream, gain); + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); } - pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(audiostream, @ptrCast(count))); + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); } - pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(audiostream, @ptrCast(count))); + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); } pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamInputChannelMap(audiostream, chmap, count); + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { - return c.SDL_SetAudioStreamOutputChannelMap(audiostream, chmap, count); + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); } pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { - return c.SDL_PutAudioStreamData(audiostream, buf, len); + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); } pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { - return c.SDL_PutAudioStreamDataNoCopy(audiostream, buf, len, callback, userdata); + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); } - pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const void * const, num_channels: c_int, num_samples: c_int) bool { - return c.SDL_PutAudioStreamPlanarData(audiostream, channel_buffers, num_channels, num_samples); + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); } pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { - return c.SDL_GetAudioStreamData(audiostream, buf, len); + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); } pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamAvailable(audiostream); + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); } pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { - return c.SDL_GetAudioStreamQueued(audiostream); + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); } pub inline fn flushAudioStream(audiostream: *AudioStream) bool { - return c.SDL_FlushAudioStream(audiostream); + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn clearAudioStream(audiostream: *AudioStream) bool { - return c.SDL_ClearAudioStream(audiostream); + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_PauseAudioStreamDevice(audiostream); + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { - return c.SDL_ResumeAudioStreamDevice(audiostream); + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); } pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { - return c.SDL_AudioStreamDevicePaused(audiostream); + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); } pub inline fn lockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_LockAudioStream(audiostream); + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { - return c.SDL_UnlockAudioStream(audiostream); + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); } pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamGetCallback(audiostream, callback, userdata); + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioStreamPutCallback(audiostream, callback, userdata); + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); } pub inline fn destroyAudioStream(audiostream: *AudioStream) void { - return c.SDL_DestroyAudioStream(audiostream); + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); } - }; pub inline fn getNumAudioDrivers() c_int { @@ -161,48 +160,48 @@ pub inline fn getCurrentAudioDriver() [*c]const u8 { return c.SDL_GetCurrentAudioDriver(); } -pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioPlaybackDevices(@ptrCast(count)); +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); } -pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID { - return c.SDL_GetAudioRecordingDevices(@ptrCast(count)); +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); } pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { return c.SDL_GetAudioDeviceName(devid); } -pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool { - return c.SDL_GetAudioDeviceFormat(devid, spec, @ptrCast(sample_frames)); +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); } -pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int { - return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count))); +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); } -pub inline fn openAudioDevice(devid: AudioDeviceID, spec: *const AudioSpec) AudioDeviceID { - return c.SDL_OpenAudioDevice(devid, @ptrCast(spec)); +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); } pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePhysical(devid); + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); } pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { - return c.SDL_IsAudioDevicePlayback(devid); + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); } pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_PauseAudioDevice(devid); + return @bitCast(c.SDL_PauseAudioDevice(devid)); } pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { - return c.SDL_ResumeAudioDevice(devid); + return @bitCast(c.SDL_ResumeAudioDevice(devid)); } pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { - return c.SDL_AudioDevicePaused(devid); + return @bitCast(c.SDL_AudioDevicePaused(devid)); } pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { @@ -210,60 +209,63 @@ pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { } pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { - return c.SDL_SetAudioDeviceGain(devid, gain); + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); } pub inline fn closeAudioDevice(devid: AudioDeviceID) void { return c.SDL_CloseAudioDevice(devid); } -pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]*const AudioStream, num_streams: c_int) bool { - return c.SDL_BindAudioStreams(devid, streams, num_streams); +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); } pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { - return c.SDL_BindAudioStream(devid, stream); + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); } -pub inline fn unbindAudioStreams(streams: [*c]*const AudioStream, num_streams: c_int) void { - return c.SDL_UnbindAudioStreams(streams, num_streams); +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); } -pub inline fn createAudioStream(src_spec: *const AudioSpec, dst_spec: *const AudioSpec) ?*AudioStream { - return c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec)); +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); } pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; pub const AudioStreamCallback = c.SDL_AudioStreamCallback; -pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: *const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { - return c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata); +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); } pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetAudioPostmixCallback(devid, callback, userdata); + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); } -pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool { - return c.SDL_LoadWAV(path, spec, audio_buf, @ptrCast(audio_len)); +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); } pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { - return c.SDL_MixAudio(dst, src, @bitCast(format), len, volume); + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); } -pub inline fn convertAudioSamples(src_spec: *const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: *const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool { - return c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len)); +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); } pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { - return c.SDL_GetAudioFormatName(@bitCast(format)); + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); } pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { - return c.SDL_GetSilenceValueForFormat(@bitCast(format)); + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); } - diff --git a/official/release-3.4.0/api/blendmode.zig b/official/release-3.4.0/api/blendmode.zig index b2a88d3..2a64eca 100644 --- a/official/release-3.4.0/api/blendmode.zig +++ b/official/release-3.4.0/api/blendmode.zig @@ -1,29 +1,28 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const BlendMode = u32; pub const BlendOperation = enum(c_int) { - blendoperationAdd, //dst + src: supported by all renderers - blendoperationSubtract, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationRevSubtract, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMinimum, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan - blendoperationMaximum, + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan }; pub const BlendFactor = enum(c_int) { - blendfactorZero, //0, 0, 0, 0 - blendfactorOne, //1, 1, 1, 1 - blendfactorSrcColor, //srcR, srcG, srcB, srcA - blendfactorOneMinusSrcColor, //1-srcR, 1-srcG, 1-srcB, 1-srcA - blendfactorSrcAlpha, //srcA, srcA, srcA, srcA - blendfactorOneMinusSrcAlpha, //1-srcA, 1-srcA, 1-srcA, 1-srcA - blendfactorDstColor, //dstR, dstG, dstB, dstA - blendfactorOneMinusDstColor, //1-dstR, 1-dstG, 1-dstB, 1-dstA - blendfactorDstAlpha, //dstA, dstA, dstA, dstA - blendfactorOneMinusDstAlpha, + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA }; pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { - return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation))); + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); } diff --git a/official/release-3.4.0/api/c.zig b/official/release-3.4.0/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.0/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.0/api/camera.zig b/official/release-3.4.0/api/camera.zig index ce5e690..d1b7dd4 100644 --- a/official/release-3.4.0/api/camera.zig +++ b/official/release-3.4.0/api/camera.zig @@ -1,81 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG -}; - -pub const Surface = opaque {}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const CameraID = u32; pub const Camera = opaque { pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { - return c.SDL_GetCameraPermissionState(camera); + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); } pub inline fn getCameraID(camera: *Camera) CameraID { - return c.SDL_GetCameraID(camera); + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); } pub inline fn getCameraProperties(camera: *Camera) PropertiesID { - return c.SDL_GetCameraProperties(camera); + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); } pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { - return c.SDL_GetCameraFormat(camera, spec); + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); } - pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface { - return c.SDL_AcquireCameraFrame(camera, @ptrCast(timestampNS)); + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); } pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { - return c.SDL_ReleaseCameraFrame(camera, frame); + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); } pub inline fn closeCamera(camera: *Camera) void { - return c.SDL_CloseCamera(camera); + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); } }; @@ -95,6 +57,7 @@ pub const CameraPosition = enum(c_int) { }; pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, cameraPermissionStatePending, cameraPermissionStateApproved, }; @@ -111,12 +74,12 @@ pub inline fn getCurrentCameraDriver() [*c]const u8 { return c.SDL_GetCurrentCameraDriver(); } -pub inline fn getCameras(count: *c_int) ?*CameraID { - return c.SDL_GetCameras(@ptrCast(count)); +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c][*c]CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { @@ -124,9 +87,9 @@ pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { } pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { - return c.SDL_GetCameraPosition(instance_id); + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); } -pub inline fn openCamera(instance_id: CameraID, spec: *const CameraSpec) ?*Camera { - return c.SDL_OpenCamera(instance_id, @ptrCast(spec)); +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); } diff --git a/official/release-3.4.0/api/clipboard.zig b/official/release-3.4.0/api/clipboard.zig index 2847baa..6fe8270 100644 --- a/official/release-3.4.0/api/clipboard.zig +++ b/official/release-3.4.0/api/clipboard.zig @@ -1,8 +1,7 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn setClipboardText(text: [*c]const u8) bool { - return c.SDL_SetClipboardText(text); + return @bitCast(c.SDL_SetClipboardText(text)); } pub inline fn getClipboardText() [*c]u8 { @@ -10,11 +9,11 @@ pub inline fn getClipboardText() [*c]u8 { } pub inline fn hasClipboardText() bool { - return c.SDL_HasClipboardText(); + return @bitCast(c.SDL_HasClipboardText()); } pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { - return c.SDL_SetPrimarySelectionText(text); + return @bitCast(c.SDL_SetPrimarySelectionText(text)); } pub inline fn getPrimarySelectionText() [*c]u8 { @@ -22,7 +21,7 @@ pub inline fn getPrimarySelectionText() [*c]u8 { } pub inline fn hasPrimarySelectionText() bool { - return c.SDL_HasPrimarySelectionText(); + return @bitCast(c.SDL_HasPrimarySelectionText()); } pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; @@ -30,21 +29,21 @@ pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { - return c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types); + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); } pub inline fn clearClipboardData() bool { - return c.SDL_ClearClipboardData(); + return @bitCast(c.SDL_ClearClipboardData()); } -pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque { - return c.SDL_GetClipboardData(mime_type, @ptrCast(size)); +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); } pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { - return c.SDL_HasClipboardData(mime_type); + return @bitCast(c.SDL_HasClipboardData(mime_type)); } -pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 { - return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types)); +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); } diff --git a/official/release-3.4.0/api/dialog.zig b/official/release-3.4.0/api/dialog.zig index 17ee2ac..5f94fcf 100644 --- a/official/release-3.4.0/api/dialog.zig +++ b/official/release-3.4.0/api/dialog.zig @@ -1,9 +1,10 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); -pub const Window = opaque {}; - -pub const PropertiesID = u32; +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; pub const DialogFileFilter = extern struct { name: [*c]const u8, @@ -12,16 +13,16 @@ pub const DialogFileFilter = extern struct { pub const DialogFileCallback = c.SDL_DialogFileCallback; -pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location, allow_many); +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); } -pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { - return c.SDL_ShowSaveFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location); +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); } pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { - return c.SDL_ShowOpenFolderDialog(callback, userdata, window, default_location, allow_many); + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); } pub const FileDialogType = enum(c_int) { @@ -31,5 +32,5 @@ pub const FileDialogType = enum(c_int) { }; pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { - return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props); + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); } diff --git a/official/release-3.4.0/api/error.zig b/official/release-3.4.0/api/error.zig index 1954227..9752b22 100644 --- a/official/release-3.4.0/api/error.zig +++ b/official/release-3.4.0/api/error.zig @@ -1,8 +1,12 @@ const std = @import("std"); pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; pub inline fn outOfMemory() bool { - return c.SDL_OutOfMemory(); + return @bitCast(c.SDL_OutOfMemory()); } pub inline fn getError() [*c]const u8 { @@ -10,5 +14,5 @@ pub inline fn getError() [*c]const u8 { } pub inline fn clearError() bool { - return c.SDL_ClearError(); + return @bitCast(c.SDL_ClearError()); } diff --git a/official/release-3.4.0/api/events.zig b/official/release-3.4.0/api/events.zig index df0464f..6c62826 100644 --- a/official/release-3.4.0/api/events.zig +++ b/official/release-3.4.0/api/events.zig @@ -1,165 +1,51 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); -pub const PenID = u32; - -pub const WindowID = u32; - -pub const AudioDeviceID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, - rsvd: bool = false, -}; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash, - scancodeNonushash, - scancodeGrave, - scancodeInsert, - scancodeNumlockclear, - scancodeNonusbackslash, - scancodeApplication, //windows contextual menu, compose - scancodePower, - scancodeHelp, //AL Integrated Help Center - scancodeMenu, //Menu (show menu) - scancodeStop, //AC Stop - scancodeAgain, //AC Redo/Repeat - scancodeUndo, //AC Undo - scancodeCut, //AC Cut - scancodeCopy, //AC Copy - scancodePaste, //AC Paste - scancodeFind, //AC Find - scancodeInternational1, - scancodeInternational3, //Yen - scancodeLang1, //Hangul/English toggle - scancodeLang2, //Hanja conversion - scancodeLang3, //Katakana - scancodeLang4, //Hiragana - scancodeLang5, //Zenkaku/Hankaku - scancodeLang6, //reserved - scancodeLang7, //reserved - scancodeLang8, //reserved - scancodeLang9, //reserved - scancodeAlterase, //Erase-Eaze - scancodeCancel, //AC Cancel - scancodeLalt, //alt, option - scancodeLgui, //windows, command (apple), meta - scancodeRalt, //alt gr, option - scancodeRgui, //windows, command (apple), meta - scancodeMode, - scancodeSleep, //Sleep - scancodeWake, //Wake - scancodeChannelIncrement, //Channel Increment - scancodeChannelDecrement, //Channel Decrement - scancodeMediaPlay, //Play - scancodeMediaPause, //Pause - scancodeMediaRecord, //Record - scancodeMediaFastForward, //Fast Forward - scancodeMediaRewind, //Rewind - scancodeMediaNextTrack, //Next Track - scancodeMediaPreviousTrack, //Previous Track - scancodeMediaStop, //Stop - scancodeMediaEject, //Eject - scancodeMediaPlayPause, //Play / Pause - scancodeMediaSelect, - scancodeAcNew, //AC New - scancodeAcOpen, //AC Open - scancodeAcClose, //AC Close - scancodeAcExit, //AC Exit - scancodeAcSave, //AC Save - scancodeAcPrint, //AC Print - scancodeAcProperties, //AC Properties - scancodeAcSearch, //AC Search - scancodeAcHome, //AC Home - scancodeAcBack, //AC Back - scancodeAcForward, //AC Forward - scancodeAcStop, //AC Stop - scancodeAcRefresh, //AC Refresh - scancodeAcBookmarks, //AC Bookmarks - scancodeSoftleft, - scancodeSoftright, - scancodeCall, //Used for accepting phone calls. - scancodeEndcall, //Used for rejecting phone calls. - scancodeReserved, //400-500 reserved for dynamic keycodes - scancodeCount, -}; - -pub const TouchID = u64; - -pub const KeyboardID = u32; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const MouseID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PowerState = enum(c_int) { - powerstateError, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Window = opaque {}; - -pub const FingerID = u64; - -pub const Keycode = u32; - -pub const SensorID = u32; - -pub const JoystickID = u32; - -pub const Keymod = u16; +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; pub const EventType = enum(c_int) { - eventFirst, //Unused (do not remove) - eventQuit, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() eventLocaleChanged, //The user's locale preferences have changed. eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation, //Display orientation has changed to data1 + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 eventDisplayAdded, //Display has been added to the system eventDisplayRemoved, //Display has been removed from the system eventDisplayMoved, //Display has changed position @@ -167,9 +53,9 @@ pub const EventType = enum(c_int) { eventDisplayCurrentModeChanged, //Display has changed current mode eventDisplayContentScaleChanged, //Display has changed content scale eventDisplayUsableBoundsChanged, //Display has changed usable bounds - eventWindowShown, //Window has been shown + eventWindowShown = 0x202, //Window has been shown eventWindowHidden, //Window has been hidden - eventWindowExposed, + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. eventWindowMoved, //Window has been moved to data1, data2 eventWindowResized, //Window has been resized to data1xdata2 eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 @@ -190,25 +76,25 @@ pub const EventType = enum(c_int) { eventWindowOccluded, //The window has been occluded eventWindowEnterFullscreen, //The window has entered fullscreen mode eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown, //Key pressed + eventKeyDown = 0x300, //Key pressed eventKeyUp, //Key released eventTextEditing, //Keyboard text editing (composition) eventTextInput, //Keyboard text input - eventKeymapChanged, + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates eventScreenKeyboardShown, //The on-screen keyboard has been shown eventScreenKeyboardHidden, //The on-screen keyboard has been hidden - eventMouseMotion, //Mouse moved + eventMouseMotion = 0x400, //Mouse moved eventMouseButtonDown, //Mouse button pressed eventMouseButtonUp, //Mouse button released eventMouseWheel, //Mouse wheel motion eventMouseAdded, //A new mouse has been inserted into the system eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion, //Joystick axis motion + eventJoystickAxisMotion = 0x600, //Joystick axis motion eventJoystickBallMotion, //Joystick trackball motion eventJoystickHatMotion, //Joystick hat position change eventJoystickButtonDown, //Joystick button pressed @@ -217,7 +103,7 @@ pub const EventType = enum(c_int) { eventJoystickRemoved, //An opened joystick has been removed eventJoystickBatteryUpdated, //Joystick battery level change eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion, //Gamepad axis motion + eventGamepadAxisMotion = 0x650, //Gamepad axis motion eventGamepadButtonDown, //Gamepad button pressed eventGamepadButtonUp, //Gamepad button released eventGamepadAdded, //A new gamepad has been inserted into the system @@ -229,23 +115,24 @@ pub const EventType = enum(c_int) { eventGamepadSensorUpdate, //Gamepad sensor was updated eventGamepadUpdateComplete, //Gamepad update is complete eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, eventFingerUp, eventFingerMotion, eventFingerCanceled, - eventPinchBegin, //Pinch gesture started + eventPinchBegin = 0x710, //Pinch gesture started eventPinchUpdate, //Pinch gesture updated eventPinchEnd, //Pinch gesture ended - eventClipboardUpdate, //The clipboard changed - eventDropFile, //The system requests a file open + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open eventDropText, //text/plain drag-and-drop event eventDropBegin, //A new set of drops is beginning (NULL filename) eventDropComplete, //Current set of drops is now complete (NULL filename) eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded, //A new audio device is available + eventAudioDeviceAdded = 0x1100, //A new audio device is available eventAudioDeviceRemoved, //An audio device has been removed. eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate, //A sensor was updated - eventPenProximityIn, //Pressure-sensitive pen has become available + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available eventPenProximityOut, //Pressure-sensitive pen has become unavailable eventPenDown, //Pressure-sensitive pen touched drawing surface eventPenUp, //Pressure-sensitive pen stopped touching drawing surface @@ -253,17 +140,26 @@ pub const EventType = enum(c_int) { eventPenButtonUp, //Pressure-sensitive pen button released eventPenMotion, //Pressure-sensitive pen is moving on the tablet eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded, //A new camera device is available + eventCameraDeviceAdded = 0x1400, //A new camera device is available eventCameraDeviceRemoved, //A camera device has been removed. eventCameraDeviceApproved, //A camera device has been approved for use by the user. eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset, //The render targets have been reset and their contents need to be updated + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated eventRenderDeviceReset, //The device has been reset and all textures need to be recreated eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, eventPrivate1, eventPrivate2, eventPrivate3, - eventPollSentinel, //Signals the end of an event poll cycle + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; }; pub const CommonEvent = extern struct { @@ -326,7 +222,7 @@ pub const TextEditingCandidatesEvent = extern struct { reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available num_candidates: i32, // The number of strings in `candidates` selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected horizontal: bool, // true if the list is horizontal, false if it's vertical @@ -424,6 +320,7 @@ pub const JoyHatEvent = extern struct { timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() which: JoystickID, // The joystick instance id hat: u8, // The joystick hat index + value: u8, padding1: u8, padding2: u8, }; @@ -712,15 +609,15 @@ pub const EventAction = enum(c_int) { }; pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { - return c.SDL_PeepEvents(events, numevents, action, minType, maxType); + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); } pub inline fn hasEvent(_type: u32) bool { - return c.SDL_HasEvent(_type); + return @bitCast(c.SDL_HasEvent(_type)); } pub inline fn hasEvents(minType: u32, maxType: u32) bool { - return c.SDL_HasEvents(minType, maxType); + return @bitCast(c.SDL_HasEvents(minType, maxType)); } pub inline fn flushEvent(_type: u32) void { @@ -732,19 +629,19 @@ pub inline fn flushEvents(minType: u32, maxType: u32) void { } pub inline fn pollEvent(event: ?*Event) bool { - return c.SDL_PollEvent(event); + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEvent(event: ?*Event) bool { - return c.SDL_WaitEvent(event); + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); } pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { - return c.SDL_WaitEventTimeout(event, timeoutMS); + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); } pub inline fn pushEvent(event: ?*Event) bool { - return c.SDL_PushEvent(event); + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); } pub const EventFilter = c.SDL_EventFilter; @@ -754,11 +651,11 @@ pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { - return c.SDL_GetEventFilter(filter, userdata); + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); } pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { - return c.SDL_AddEventWatch(filter, userdata); + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); } pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { @@ -770,21 +667,21 @@ pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { } pub inline fn setEventEnabled(_type: u32, enabled: bool) void { - return c.SDL_SetEventEnabled(_type, enabled); + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); } pub inline fn eventEnabled(_type: u32) bool { - return c.SDL_EventEnabled(_type); + return @bitCast(c.SDL_EventEnabled(_type)); } pub inline fn registerEvents(numevents: c_int) u32 { return c.SDL_RegisterEvents(numevents); } -pub inline fn getWindowFromEvent(event: *const Event) ?*Window { - return c.SDL_GetWindowFromEvent(@ptrCast(event)); +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); } -pub inline fn getEventDescription(event: *const Event, buf: [*c]u8, buflen: c_int) c_int { - return c.SDL_GetEventDescription(@ptrCast(event), buf, buflen); +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); } diff --git a/official/release-3.4.0/api/filesystem.zig b/official/release-3.4.0/api/filesystem.zig index f8ee2d4..48f8e71 100644 --- a/official/release-3.4.0/api/filesystem.zig +++ b/official/release-3.4.0/api/filesystem.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub inline fn getBasePath() [*c]const u8 { return c.SDL_GetBasePath(); @@ -23,18 +24,18 @@ pub const Folder = enum(c_int) { folderScreenshots, //Application screenshots. folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. folderVideos, //Video files that can be played using a standard video player (mp4, webm...). - folderCount, + folderCount, //Total number of types in this enum, not a folder type by itself. }; pub inline fn getUserFolder(folder: Folder) [*c]const u8 { - return c.SDL_GetUserFolder(folder); + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); } pub const PathType = enum(c_int) { pathtypeNone, //path does not exist pathtypeFile, //a normal file pathtypeDirectory, //a directory - pathtypeOther, + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) }; pub const PathInfo = extern struct { @@ -49,42 +50,44 @@ pub const GlobFlags = packed struct(u32) { globCaseinsensitive: bool = false, pad0: u30 = 0, rsvd: bool = false, + + pub const None = GlobFlags{}; }; pub inline fn createDirectory(path: [*c]const u8) bool { - return c.SDL_CreateDirectory(path); + return @bitCast(c.SDL_CreateDirectory(path)); } pub const EnumerationResult = enum(c_int) { enumContinue, //Value that requests that enumeration continue. enumSuccess, //Value that requests that enumeration stop, successfully. - enumFailure, + enumFailure, //Value that requests that enumeration stop, as a failure. }; pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateDirectory(path, callback, userdata); + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); } pub inline fn removePath(path: [*c]const u8) bool { - return c.SDL_RemovePath(path); + return @bitCast(c.SDL_RemovePath(path)); } pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_RenamePath(oldpath, newpath); + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); } pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_CopyFile(oldpath, newpath); + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); } pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { - return c.SDL_GetPathInfo(path, info); + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); } -pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count)); +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); } pub inline fn getCurrentDirectory() [*c]u8 { diff --git a/official/release-3.4.0/api/gamepad.zig b/official/release-3.4.0/api/gamepad.zig index 541242c..f3ebe5c 100644 --- a/official/release-3.4.0/api/gamepad.zig +++ b/official/release-3.4.0/api/gamepad.zig @@ -1,212 +1,185 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); -pub const JoystickConnectionState = enum(c_int) { - joystickConnectionUnknown, - joystickConnectionWired, - joystickConnectionWireless, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PropertiesID = u32; - -pub const IOStream = opaque { - pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int { - return c.SDL_AddGamepadMappingsFromIO(iostream, closeio); - } -}; - -pub const JoystickID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const PowerState = enum(c_int) { - powerstateError, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const Joystick = opaque {}; +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; pub const Gamepad = opaque { pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { - return c.SDL_GetGamepadMapping(gamepad); + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { - return c.SDL_GetGamepadProperties(gamepad); + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { - return c.SDL_GetGamepadID(gamepad); + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadName(gamepad); + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadPath(gamepad); + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetGamepadType(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadType(gamepad)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); } pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { - return c.SDL_GetGamepadPlayerIndex(gamepad); + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); } pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { - return c.SDL_SetGamepadPlayerIndex(gamepad, player_index); + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); } pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadVendor(gamepad); + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProduct(gamepad); + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadProductVersion(gamepad); + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { - return c.SDL_GetGamepadFirmwareVersion(gamepad); + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { - return c.SDL_GetGamepadSerial(gamepad); + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { - return c.SDL_GetGamepadSteamHandle(gamepad); + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { - return c.SDL_GetGamepadConnectionState(gamepad); + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState { - return c.SDL_GetGamepadPowerInfo(gamepad, @ptrCast(percent)); + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); } pub inline fn gamepadConnected(gamepad: *Gamepad) bool { - return c.SDL_GamepadConnected(gamepad); + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); } pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { - return c.SDL_GetGamepadJoystick(gamepad); + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); } - pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c][*c]GamepadBinding { - return c.SDL_GetGamepadBindings(gamepad, @ptrCast(count)); + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); } pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { - return c.SDL_GamepadHasAxis(gamepad, axis); + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); } pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { - return c.SDL_GetGamepadAxis(gamepad, axis); + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { - return c.SDL_GamepadHasButton(gamepad, button); + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { - return c.SDL_GetGamepadButton(gamepad, button); + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); } pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabel(gamepad, button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); } pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { - return c.SDL_GetNumGamepadTouchpads(gamepad); + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); } pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { - return c.SDL_GetNumGamepadTouchpadFingers(gamepad, touchpad); + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); } - pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool { - return c.SDL_GetGamepadTouchpadFinger(gamepad, touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure)); + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); } pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { - return c.SDL_GamepadHasSensor(gamepad, @intFromEnum(_type)); + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { - return c.SDL_SetGamepadSensorEnabled(gamepad, @intFromEnum(_type), enabled); + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); } pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { - return c.SDL_GamepadSensorEnabled(gamepad, @intFromEnum(_type)); + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); } pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { - return c.SDL_GetGamepadSensorDataRate(gamepad, @intFromEnum(_type)); + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); } - pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool { - return c.SDL_GetGamepadSensorData(gamepad, @intFromEnum(_type), @ptrCast(data), num_values); + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); } pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleGamepad(gamepad, low_frequency_rumble, high_frequency_rumble, duration_ms); + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleGamepadTriggers(gamepad, left_rumble, right_rumble, duration_ms); + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); } pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { - return c.SDL_SetGamepadLED(gamepad, red, green, blue); + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); } pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { - return c.SDL_SendGamepadEffect(gamepad, data, size); + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); } pub inline fn closeGamepad(gamepad: *Gamepad) void { - return c.SDL_CloseGamepad(gamepad); + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); } pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForButton(gamepad, button); + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); } pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(gamepad, axis); + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); } }; pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, gamepadTypeStandard, gamepadTypeXbox360, gamepadTypeXboxone, @@ -222,6 +195,7 @@ pub const GamepadType = enum(c_int) { }; pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) gamepadButtonEast, //Right face button (e.g. Xbox B button) gamepadButtonWest, //Left face button (e.g. Xbox X button) @@ -264,6 +238,7 @@ pub const GamepadButtonLabel = enum(c_int) { }; pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, gamepadAxisLeftx, gamepadAxisLefty, gamepadAxisRightx, @@ -274,6 +249,7 @@ pub const GamepadAxis = enum(c_int) { }; pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, gamepadBindtypeButton, gamepadBindtypeAxis, gamepadBindtypeHat, @@ -285,36 +261,40 @@ pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { return c.SDL_AddGamepadMapping(mapping); } +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { return c.SDL_AddGamepadMappingsFromFile(file); } pub inline fn reloadGamepadMappings() bool { - return c.SDL_ReloadGamepadMappings(); + return @bitCast(c.SDL_ReloadGamepadMappings()); } -pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 { - return c.SDL_GetGamepadMappings(@ptrCast(count)); +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); } pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { - return c.SDL_GetGamepadMappingForGUID(guid); + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); } pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { - return c.SDL_SetGamepadMapping(instance_id, mapping); + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); } pub inline fn hasGamepad() bool { - return c.SDL_HasGamepad(); + return @bitCast(c.SDL_HasGamepad()); } -pub inline fn getGamepads(count: *c_int) ?*JoystickID { - return c.SDL_GetGamepads(@ptrCast(count)); +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); } pub inline fn isGamepad(instance_id: JoystickID) bool { - return c.SDL_IsGamepad(instance_id); + return @bitCast(c.SDL_IsGamepad(instance_id)); } pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { @@ -330,7 +310,7 @@ pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetGamepadGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; } pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { @@ -346,11 +326,11 @@ pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); } pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { - return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); } pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { @@ -358,23 +338,23 @@ pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { } pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { - return c.SDL_OpenGamepad(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); } pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { - return c.SDL_GetGamepadFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); } pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { - return c.SDL_GetGamepadFromPlayerIndex(player_index); + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); } pub inline fn setGamepadEventsEnabled(enabled: bool) void { - return c.SDL_SetGamepadEventsEnabled(enabled); + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); } pub inline fn gamepadEventsEnabled() bool { - return c.SDL_GamepadEventsEnabled(); + return @bitCast(c.SDL_GamepadEventsEnabled()); } pub inline fn updateGamepads() void { @@ -382,29 +362,29 @@ pub inline fn updateGamepads() void { } pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { - return @intFromEnum(c.SDL_GetGamepadTypeFromString(str)); + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); } pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { - return c.SDL_GetGamepadStringForType(@intFromEnum(_type)); + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); } pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { - return c.SDL_GetGamepadAxisFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); } pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { - return c.SDL_GetGamepadStringForAxis(axis); + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); } pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { - return c.SDL_GetGamepadButtonFromString(str); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); } pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { - return c.SDL_GetGamepadStringForButton(button); + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); } pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { - return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button); + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); } diff --git a/official/release-3.4.0/api/gpu.zig b/official/release-3.4.0/api/gpu.zig index 1c51feb..5dc12ac 100644 --- a/official/release-3.4.0/api/gpu.zig +++ b/official/release-3.4.0/api/gpu.zig @@ -1,199 +1,173 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const PropertiesID = u32; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Window = opaque {}; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical, //flip horizontally and vertically (not a diagonal flip) -}; +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; pub const GPUDevice = opaque { pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { - return c.SDL_DestroyGPUDevice(gpudevice); + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { - return c.SDL_GetGPUDeviceDriver(gpudevice); + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); } pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { - return @bitCast(c.SDL_GetGPUShaderFormats(gpudevice)); + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); } pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { - return c.SDL_GetGPUDeviceProperties(gpudevice); + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); } - pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: *const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { - return c.SDL_CreateGPUComputePipeline(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: *const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { - return c.SDL_CreateGPUGraphicsPipeline(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: *const GPUSamplerCreateInfo) ?*GPUSampler { - return c.SDL_CreateGPUSampler(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: *const GPUShaderCreateInfo) ?*GPUShader { - return c.SDL_CreateGPUShader(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: *const GPUTextureCreateInfo) ?*GPUTexture { - return c.SDL_CreateGPUTexture(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: *const GPUBufferCreateInfo) ?*GPUBuffer { - return c.SDL_CreateGPUBuffer(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } - pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: *const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { - return c.SDL_CreateGPUTransferBuffer(gpudevice, @ptrCast(createinfo)); + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { - return c.SDL_SetGPUBufferName(gpudevice, buffer, text); + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); } pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { - return c.SDL_SetGPUTextureName(gpudevice, texture, text); + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); } pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { - return c.SDL_ReleaseGPUTexture(gpudevice, texture); + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); } pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { - return c.SDL_ReleaseGPUSampler(gpudevice, sampler); + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); } pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { - return c.SDL_ReleaseGPUBuffer(gpudevice, buffer); + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); } pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_ReleaseGPUTransferBuffer(gpudevice, transfer_buffer); + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_ReleaseGPUComputePipeline(gpudevice, compute_pipeline); + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); } pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { - return c.SDL_ReleaseGPUShader(gpudevice, shader); + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); } pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_ReleaseGPUGraphicsPipeline(gpudevice, graphics_pipeline); + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); } pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { - return c.SDL_AcquireGPUCommandBuffer(gpudevice); + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); } pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { - return c.SDL_MapGPUTransferBuffer(gpudevice, transfer_buffer, cycle); + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); } pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { - return c.SDL_UnmapGPUTransferBuffer(gpudevice, transfer_buffer); + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); } pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { - return c.SDL_WindowSupportsGPUSwapchainComposition(gpudevice, window, swapchain_composition); + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); } pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { - return c.SDL_WindowSupportsGPUPresentMode(gpudevice, window, @intFromEnum(present_mode)); + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); } pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { - return c.SDL_ClaimWindowForGPUDevice(gpudevice, window); + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { - return c.SDL_ReleaseWindowFromGPUDevice(gpudevice, window); + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); } pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { - return c.SDL_SetGPUSwapchainParameters(gpudevice, window, swapchain_composition, @intFromEnum(present_mode)); + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); } pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { - return c.SDL_SetGPUAllowedFramesInFlight(gpudevice, allowed_frames_in_flight); + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); } pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUSwapchainTextureFormat(gpudevice, window)); + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); } pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { - return c.SDL_WaitForGPUSwapchain(gpudevice, window); + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); } pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { - return c.SDL_WaitForGPUIdle(gpudevice); + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); } - pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]*const GPUFence, num_fences: u32) bool { - return c.SDL_WaitForGPUFences(gpudevice, wait_all, fences, num_fences); + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); } pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { - return c.SDL_QueryGPUFence(gpudevice, fence); + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); } pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { - return c.SDL_ReleaseGPUFence(gpudevice, fence); + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); } pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { - return c.SDL_GPUTextureSupportsFormat(gpudevice, @bitCast(format), @intFromEnum(_type), @bitCast(usage)); + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); } pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { - return c.SDL_GPUTextureSupportsSampleCount(gpudevice, @bitCast(format), sample_count); + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); } pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKSuspendGPU(gpudevice); + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); } pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { - return c.SDL_GDKResumeGPU(gpudevice); + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); } }; @@ -213,201 +187,201 @@ pub const GPUGraphicsPipeline = opaque {}; pub const GPUCommandBuffer = opaque { pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { - return c.SDL_InsertGPUDebugLabel(gpucommandbuffer, text); + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); } pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { - return c.SDL_PushGPUDebugGroup(gpucommandbuffer, name); + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); } pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { - return c.SDL_PopGPUDebugGroup(gpucommandbuffer); + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); } pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUVertexUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUFragmentUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { - return c.SDL_PushGPUComputeUniformData(gpucommandbuffer, slot_index, data, length); + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); } - pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: *const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: *const GPUDepthStencilTargetInfo) ?*GPURenderPass { - return c.SDL_BeginGPURenderPass(gpucommandbuffer, @ptrCast(color_target_infos), num_color_targets, @ptrCast(depth_stencil_target_info)); + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); } - pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: *const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: *const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { - return c.SDL_BeginGPUComputePass(gpucommandbuffer, @ptrCast(storage_texture_bindings), num_storage_texture_bindings, @ptrCast(storage_buffer_bindings), num_storage_buffer_bindings); + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); } pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { - return c.SDL_BeginGPUCopyPass(gpucommandbuffer); + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { - return c.SDL_GenerateMipmapsForGPUTexture(gpucommandbuffer, texture); + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); } - pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: *const GPUBlitInfo) void { - return c.SDL_BlitGPUTexture(gpucommandbuffer, @ptrCast(info)); + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); } - pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c][*c]GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return c.SDL_AcquireGPUSwapchainTexture(gpucommandbuffer, window, swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height)); + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } - pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c][*c]GPUTexture, swapchain_texture_width: *u32, swapchain_texture_height: *u32) bool { - return c.SDL_WaitAndAcquireGPUSwapchainTexture(gpucommandbuffer, window, swapchain_texture, @ptrCast(swapchain_texture_width), @ptrCast(swapchain_texture_height)); + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); } pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return c.SDL_SubmitGPUCommandBuffer(gpucommandbuffer); + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { - return c.SDL_SubmitGPUCommandBufferAndAcquireFence(gpucommandbuffer); + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); } pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { - return c.SDL_CancelGPUCommandBuffer(gpucommandbuffer); + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); } }; pub const GPURenderPass = opaque { pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { - return c.SDL_BindGPUGraphicsPipeline(gpurenderpass, graphics_pipeline); + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); } - pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: *const GPUViewport) void { - return c.SDL_SetGPUViewport(gpurenderpass, @ptrCast(viewport)); + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); } - pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: *const Rect) void { - return c.SDL_SetGPUScissor(gpurenderpass, @ptrCast(scissor)); + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); } pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { - return c.SDL_SetGPUBlendConstants(gpurenderpass, blend_constants); + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); } pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { - return c.SDL_SetGPUStencilReference(gpurenderpass, reference); + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); } - pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: *const GPUBufferBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexBuffers(gpurenderpass, first_slot, @ptrCast(bindings), num_bindings); + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); } - pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: *const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { - return c.SDL_BindGPUIndexBuffer(gpurenderpass, @ptrCast(binding), index_element_size); + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); } - pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUVertexSamplers(gpurenderpass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageTextures(gpurenderpass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUVertexStorageBuffers(gpurenderpass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } - pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUFragmentSamplers(gpurenderpass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageTextures(gpurenderpass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUFragmentStorageBuffers(gpurenderpass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { - return c.SDL_DrawGPUIndexedPrimitives(gpurenderpass, num_indices, num_instances, first_index, vertex_offset, first_instance); + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); } pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { - return c.SDL_DrawGPUPrimitives(gpurenderpass, num_vertices, num_instances, first_vertex, first_instance); + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); } pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUPrimitivesIndirect(gpurenderpass, buffer, offset, draw_count); + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { - return c.SDL_DrawGPUIndexedPrimitivesIndirect(gpurenderpass, buffer, offset, draw_count); + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); } pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { - return c.SDL_EndGPURenderPass(gpurenderpass); + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); } }; pub const GPUComputePass = opaque { pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { - return c.SDL_BindGPUComputePipeline(gpucomputepass, compute_pipeline); + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); } - pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: *const GPUTextureSamplerBinding, num_bindings: u32) void { - return c.SDL_BindGPUComputeSamplers(gpucomputepass, first_slot, @ptrCast(texture_sampler_bindings), num_bindings); + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); } - pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]*const GPUTexture, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageTextures(gpucomputepass, first_slot, storage_textures, num_bindings); + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); } - pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]*const GPUBuffer, num_bindings: u32) void { - return c.SDL_BindGPUComputeStorageBuffers(gpucomputepass, first_slot, storage_buffers, num_bindings); + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); } pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { - return c.SDL_DispatchGPUCompute(gpucomputepass, groupcount_x, groupcount_y, groupcount_z); + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); } pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { - return c.SDL_DispatchGPUComputeIndirect(gpucomputepass, buffer, offset); + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); } pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { - return c.SDL_EndGPUComputePass(gpucomputepass); + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); } }; pub const GPUCopyPass = opaque { - pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureTransferInfo, destination: *const GPUTextureRegion, cycle: bool) void { - return c.SDL_UploadToGPUTexture(gpucopypass, @ptrCast(source), @ptrCast(destination), cycle); + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } - pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: *const GPUTransferBufferLocation, destination: *const GPUBufferRegion, cycle: bool) void { - return c.SDL_UploadToGPUBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination), cycle); + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); } - pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureLocation, destination: *const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { - return c.SDL_CopyGPUTextureToTexture(gpucopypass, @ptrCast(source), @ptrCast(destination), w, h, d, cycle); + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); } - pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: *const GPUBufferLocation, destination: *const GPUBufferLocation, size: u32, cycle: bool) void { - return c.SDL_CopyGPUBufferToBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination), size, cycle); + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); } - pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: *const GPUTextureRegion, destination: *const GPUTextureTransferInfo) void { - return c.SDL_DownloadFromGPUTexture(gpucopypass, @ptrCast(source), @ptrCast(destination)); + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } - pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: *const GPUBufferRegion, destination: *const GPUTransferBufferLocation) void { - return c.SDL_DownloadFromGPUBuffer(gpucopypass, @ptrCast(source), @ptrCast(destination)); + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); } pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { - return c.SDL_EndGPUCopyPass(gpucopypass); + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); } }; @@ -557,6 +531,8 @@ pub const GPUTextureUsageFlags = packed struct(u32) { textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. pad0: u24 = 0, rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; }; pub const GPUTextureType = enum(c_int) { @@ -592,6 +568,8 @@ pub const GPUBufferUsageFlags = packed struct(u32) { bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. pad0: u25 = 0, rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; }; pub const GPUTransferBufferUsage = enum(c_int) { @@ -604,7 +582,18 @@ pub const GPUShaderStage = enum(c_int) { shaderstageFragment, }; -pub const GPUShaderFormat = u32; +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; pub const GPUVertexElementFormat = enum(c_int) { vertexelementformatInvalid, @@ -691,7 +680,7 @@ pub const GPUBlendOp = enum(c_int) { blendopSubtract, //(source * source_factor) - (destination * destination_factor) blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) blendopMin, //min(source, destination) - blendopMax, + blendopMax, //max(source, destination) }; pub const GPUBlendFactor = enum(c_int) { @@ -708,7 +697,7 @@ pub const GPUBlendFactor = enum(c_int) { blendfactorOneMinusDstAlpha, //1 - destination alpha blendfactorConstantColor, //blend constant blendfactorOneMinusConstantColor, //1 - blend constant - blendfactorSrcAlphaSaturate, + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) }; pub const GPUColorComponentFlags = packed struct(u8) { @@ -718,6 +707,8 @@ pub const GPUColorComponentFlags = packed struct(u8) { colorcomponentA: bool = false, // the alpha component pad0: u3 = 0, rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; }; pub const GPUFilter = enum(c_int) { @@ -867,9 +858,9 @@ pub const GPUVertexAttribute = extern struct { }; pub const GPUVertexInputState = extern struct { - vertex_buffer_descriptions: *const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. - vertex_attributes: *const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. }; @@ -973,7 +964,7 @@ pub const GPUColorTargetDescription = extern struct { }; pub const GPUGraphicsPipelineTargetInfo = extern struct { - color_target_descriptions: *const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. num_color_targets: u32, // The number of color target descriptions in the above array. depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. @@ -1082,19 +1073,19 @@ pub const GPUStorageTextureReadWriteBinding = extern struct { }; pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { - return c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name); + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); } pub inline fn gpuSupportsProperties(props: PropertiesID) bool { - return c.SDL_GPUSupportsProperties(props); + return @bitCast(c.SDL_GPUSupportsProperties(props)); } pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { - return c.SDL_CreateGPUDevice(@bitCast(format_flags), debug_mode, name); + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); } pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { - return c.SDL_CreateGPUDeviceWithProperties(props); + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); } pub const GPUVulkanOptions = extern struct { @@ -1116,17 +1107,17 @@ pub inline fn getGPUDriver(index: c_int) [*c]const u8 { } pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { - return c.SDL_GPUTextureFormatTexelBlockSize(@bitCast(format)); + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); } pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { - return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); } pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@bitCast(format))); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); } pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@bitCast(format))); + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); } diff --git a/official/release-3.4.0/api/guid.zig b/official/release-3.4.0/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.0/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.0/api/haptic.zig b/official/release-3.4.0/api/haptic.zig index eeeeda1..018f434 100644 --- a/official/release-3.4.0/api/haptic.zig +++ b/official/release-3.4.0/api/haptic.zig @@ -1,107 +1,100 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); -pub const Joystick = opaque { - pub inline fn isJoystickHaptic(joystick: *Joystick) bool { - return c.SDL_IsJoystickHaptic(joystick); - } - - pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic { - return c.SDL_OpenHapticFromJoystick(joystick); - } -}; +pub const Joystick = joystick_api.Joystick; pub const Haptic = opaque { pub inline fn getHapticID(haptic: *Haptic) HapticID { - return c.SDL_GetHapticID(haptic); + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { - return c.SDL_GetHapticName(haptic); + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); } pub inline fn closeHaptic(haptic: *Haptic) void { - return c.SDL_CloseHaptic(haptic); + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffects(haptic); + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); } pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { - return c.SDL_GetMaxHapticEffectsPlaying(haptic); + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); } pub inline fn getHapticFeatures(haptic: *Haptic) u32 { - return c.SDL_GetHapticFeatures(haptic); + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); } pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { - return c.SDL_GetNumHapticAxes(haptic); + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); } - pub inline fn hapticEffectSupported(haptic: *Haptic, effect: *const HapticEffect) bool { - return c.SDL_HapticEffectSupported(haptic, @ptrCast(effect)); + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); } - pub inline fn createHapticEffect(haptic: *Haptic, effect: *const HapticEffect) HapticEffectID { - return c.SDL_CreateHapticEffect(haptic, @ptrCast(effect)); + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); } - pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: *const HapticEffect) bool { - return c.SDL_UpdateHapticEffect(haptic, effect, @ptrCast(data)); + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); } pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { - return c.SDL_RunHapticEffect(haptic, effect, iterations); + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); } pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { - return c.SDL_StopHapticEffect(haptic, effect); + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { - return c.SDL_DestroyHapticEffect(haptic, effect); + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); } pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { - return c.SDL_GetHapticEffectStatus(haptic, effect); + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); } pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { - return c.SDL_SetHapticGain(haptic, gain); + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); } pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { - return c.SDL_SetHapticAutocenter(haptic, autocenter); + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); } pub inline fn pauseHaptic(haptic: *Haptic) bool { - return c.SDL_PauseHaptic(haptic); + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn resumeHaptic(haptic: *Haptic) bool { - return c.SDL_ResumeHaptic(haptic); + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); } pub inline fn stopHapticEffects(haptic: *Haptic) bool { - return c.SDL_StopHapticEffects(haptic); + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); } pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { - return c.SDL_HapticRumbleSupported(haptic); + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); } pub inline fn initHapticRumble(haptic: *Haptic) bool { - return c.SDL_InitHapticRumble(haptic); + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); } pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { - return c.SDL_PlayHapticRumble(haptic, strength, length); + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); } pub inline fn stopHapticRumble(haptic: *Haptic) bool { - return c.SDL_StopHapticRumble(haptic); + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); } }; @@ -131,6 +124,7 @@ pub const HapticConstant = extern struct { }; pub const HapticPeriodic = extern struct { + _type: HapticEffectType, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -147,6 +141,7 @@ pub const HapticPeriodic = extern struct { }; pub const HapticCondition = extern struct { + _type: HapticEffectType, direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -192,7 +187,7 @@ pub const HapticCustom = extern struct { channels: u8, // Axes to use, minimum of one. period: u16, // Sample periods. samples: u16, // Amount of samples. - data: *u16, // Should contain channels*samples items. + data: [*c]u16, // Should contain channels*samples items. attack_length: u16, // Duration of the attack. attack_level: u16, // Level at the start of the attack. fade_length: u16, // Duration of the fade. @@ -211,8 +206,8 @@ pub const HapticEffect = extern union { pub const HapticID = u32; -pub inline fn getHaptics(count: *c_int) ?*HapticID { - return c.SDL_GetHaptics(@ptrCast(count)); +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); } pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { @@ -220,17 +215,25 @@ pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { } pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { - return c.SDL_OpenHaptic(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); } pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { - return c.SDL_GetHapticFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); } pub inline fn isMouseHaptic() bool { - return c.SDL_IsMouseHaptic(); + return @bitCast(c.SDL_IsMouseHaptic()); } pub inline fn openHapticFromMouse() ?*Haptic { - return c.SDL_OpenHapticFromMouse(); + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); } diff --git a/official/release-3.4.0/api/hints.zig b/official/release-3.4.0/api/hints.zig index 991da86..862a596 100644 --- a/official/release-3.4.0/api/hints.zig +++ b/official/release-3.4.0/api/hints.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const HintPriority = enum(c_int) { hintDefault, hintNormal, @@ -8,15 +7,15 @@ pub const HintPriority = enum(c_int) { }; pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { - return c.SDL_SetHintWithPriority(name, value, priority); + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); } pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetHint(name, value); + return @bitCast(c.SDL_SetHint(name, value)); } pub inline fn resetHint(name: [*c]const u8) bool { - return c.SDL_ResetHint(name); + return @bitCast(c.SDL_ResetHint(name)); } pub inline fn resetHints() void { @@ -28,13 +27,13 @@ pub inline fn getHint(name: [*c]const u8) [*c]const u8 { } pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { - return c.SDL_GetHintBoolean(name, default_value); + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); } pub const HintCallback = c.SDL_HintCallback; pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { - return c.SDL_AddHintCallback(name, callback, userdata); + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); } pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { diff --git a/official/release-3.4.0/api/init.zig b/official/release-3.4.0/api/init.zig index c34d6df..f2f7c11 100644 --- a/official/release-3.4.0/api/init.zig +++ b/official/release-3.4.0/api/init.zig @@ -1,17 +1,21 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, initHaptic: bool = false, initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` initEvents: bool = false, initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` - pad0: u23 = 0, + pad3: u14 = 0, rsvd: bool = false, + + pub const None = InitFlags{}; }; pub const AppResult = enum(c_int) { @@ -29,11 +33,11 @@ pub const AppEvent_func = c.SDL_AppEvent_func; pub const AppQuit_func = c.SDL_AppQuit_func; pub inline fn init(flags: InitFlags) bool { - return c.SDL_Init(@bitCast(flags)); + return @bitCast(c.SDL_Init(@bitCast(flags))); } pub inline fn initSubSystem(flags: InitFlags) bool { - return c.SDL_InitSubSystem(@bitCast(flags)); + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); } pub inline fn quitSubSystem(flags: InitFlags) void { @@ -49,21 +53,21 @@ pub inline fn quit() void { } pub inline fn isMainThread() bool { - return c.SDL_IsMainThread(); + return @bitCast(c.SDL_IsMainThread()); } pub const MainThreadCallback = c.SDL_MainThreadCallback; pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { - return c.SDL_RunOnMainThread(callback, userdata, wait_complete); + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); } pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { - return c.SDL_SetAppMetadata(appname, appversion, appidentifier); + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); } pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetAppMetadataProperty(name, value); + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); } pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { diff --git a/official/release-3.4.0/api/iostream.zig b/official/release-3.4.0/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.0/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.0/api/joystick.zig b/official/release-3.4.0/api/joystick.zig index 711c492..a6cee42 100644 --- a/official/release-3.4.0/api/joystick.zig +++ b/official/release-3.4.0/api/joystick.zig @@ -1,176 +1,158 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); -pub const PropertiesID = u32; - -pub const SensorType = enum(c_int) { - sensorInvalid, //Returned for an invalid sensor - sensorUnknown, //Unknown sensor type - sensorAccel, //Accelerometer - sensorGyro, //Gyroscope - sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk - sensorGyroL, //Gyroscope for left Joy-Con controller - sensorAccelR, //Accelerometer for right Joy-Con controller - sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, -}; - -pub const GUID = extern struct { - data: [16]u8, -}; - -pub const PowerState = enum(c_int) { - powerstateError, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; pub const Joystick = opaque { pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { - return c.SDL_SetJoystickVirtualAxis(joystick, axis, value); + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); } pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { - return c.SDL_SetJoystickVirtualBall(joystick, ball, xrel, yrel); + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); } pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { - return c.SDL_SetJoystickVirtualButton(joystick, button, down); + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); } pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { - return c.SDL_SetJoystickVirtualHat(joystick, hat, value); + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); } pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { - return c.SDL_SetJoystickVirtualTouchpad(joystick, touchpad, finger, down, x, y, pressure); + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); } pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { - return c.SDL_SendJoystickVirtualSensorData(joystick, @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values); + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); } pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { - return c.SDL_GetJoystickProperties(joystick); + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickName(joystick); + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickPath(joystick); + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { - return c.SDL_GetJoystickPlayerIndex(joystick); + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); } pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { - return c.SDL_SetJoystickPlayerIndex(joystick, player_index); + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); } pub inline fn getJoystickGUID(joystick: *Joystick) GUID { - return c.SDL_GetJoystickGUID(joystick); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; } pub inline fn getJoystickVendor(joystick: *Joystick) u16 { - return c.SDL_GetJoystickVendor(joystick); + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProduct(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProduct(joystick); + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickProductVersion(joystick); + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { - return c.SDL_GetJoystickFirmwareVersion(joystick); + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { - return c.SDL_GetJoystickSerial(joystick); + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickType(joystick: *Joystick) JoystickType { - return @intFromEnum(c.SDL_GetJoystickType(joystick)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); } pub inline fn joystickConnected(joystick: *Joystick) bool { - return c.SDL_JoystickConnected(joystick); + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); } pub inline fn getJoystickID(joystick: *Joystick) JoystickID { - return c.SDL_GetJoystickID(joystick); + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickAxes(joystick); + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickBalls(joystick); + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickHats(joystick); + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); } pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { - return c.SDL_GetNumJoystickButtons(joystick); + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { - return c.SDL_GetJoystickAxis(joystick, axis); + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); } - pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool { - return c.SDL_GetJoystickAxisInitialState(joystick, axis, @ptrCast(state)); + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); } - pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool { - return c.SDL_GetJoystickBall(joystick, ball, @ptrCast(dx), @ptrCast(dy)); + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); } pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { - return c.SDL_GetJoystickHat(joystick, hat); + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); } pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { - return c.SDL_GetJoystickButton(joystick, button); + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); } pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); } pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { - return c.SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms); + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); } pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { - return c.SDL_SetJoystickLED(joystick, red, green, blue); + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); } pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { - return c.SDL_SendJoystickEffect(joystick, data, size); + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); } pub inline fn closeJoystick(joystick: *Joystick) void { - return c.SDL_CloseJoystick(joystick); + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); } pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { - return c.SDL_GetJoystickConnectionState(joystick); + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); } - pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState { - return c.SDL_GetJoystickPowerInfo(joystick, @ptrCast(percent)); + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); } }; @@ -191,6 +173,7 @@ pub const JoystickType = enum(c_int) { }; pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, joystickConnectionUnknown, joystickConnectionWired, joystickConnectionWireless, @@ -205,11 +188,11 @@ pub inline fn unlockJoysticks() void { } pub inline fn hasJoystick() bool { - return c.SDL_HasJoystick(); + return @bitCast(c.SDL_HasJoystick()); } -pub inline fn getJoysticks(count: *c_int) ?*JoystickID { - return c.SDL_GetJoysticks(@ptrCast(count)); +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); } pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { @@ -225,7 +208,7 @@ pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { } pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { - return c.SDL_GetJoystickGUIDForID(instance_id); + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; } pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { @@ -241,19 +224,19 @@ pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { } pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { - return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); } pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { - return c.SDL_OpenJoystick(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); } pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { - return c.SDL_GetJoystickFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); } pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { - return c.SDL_GetJoystickFromPlayerIndex(player_index); + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); } pub const VirtualJoystickTouchpadDesc = extern struct { @@ -279,42 +262,44 @@ pub const VirtualJoystickDesc = extern struct { ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, name: [*c]const u8, // the name of the joystick - touchpads: *const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 - sensors: *const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 userdata: ?*anyopaque, // User data pointer passed to callbacks - Update: ?*const anyopaque, // Called when the joystick state should be updated - SetPlayerIndex: ?*const anyopaque, // Called when the player index is set - Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick() - RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers() - SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED() - SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect() - SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled() - Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached }; -pub inline fn attachVirtualJoystick(desc: *const VirtualJoystickDesc) JoystickID { - return c.SDL_AttachVirtualJoystick(@ptrCast(desc)); +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); } pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { - return c.SDL_DetachVirtualJoystick(instance_id); + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); } pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { - return c.SDL_IsJoystickVirtual(instance_id); + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); } -pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void { - return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16)); +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); } pub inline fn setJoystickEventsEnabled(enabled: bool) void { - return c.SDL_SetJoystickEventsEnabled(enabled); + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); } pub inline fn joystickEventsEnabled() bool { - return c.SDL_JoystickEventsEnabled(); + return @bitCast(c.SDL_JoystickEventsEnabled()); } pub inline fn updateJoysticks() void { diff --git a/official/release-3.4.0/api/keyboard.zig b/official/release-3.4.0/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.0/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.0/api/keycode.zig b/official/release-3.4.0/api/keycode.zig index d0aaa55..8a6faae 100644 --- a/official/release-3.4.0/api/keycode.zig +++ b/official/release-3.4.0/api/keycode.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Keycode = u32; pub const Keymod = u16; diff --git a/official/release-3.4.0/api/loadso.zig b/official/release-3.4.0/api/loadso.zig index 6bf3894..aa318c0 100644 --- a/official/release-3.4.0/api/loadso.zig +++ b/official/release-3.4.0/api/loadso.zig @@ -1,18 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const SharedObject = opaque { pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { - return c.SDL_LoadFunction(sharedobject, name); + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); } pub inline fn unloadObject(sharedobject: *SharedObject) void { - return c.SDL_UnloadObject(sharedobject); + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); } }; pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { - return c.SDL_LoadObject(sofile); + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); } diff --git a/official/release-3.4.0/api/messagebox.zig b/official/release-3.4.0/api/messagebox.zig index b7820eb..84c5f01 100644 --- a/official/release-3.4.0/api/messagebox.zig +++ b/official/release-3.4.0/api/messagebox.zig @@ -1,16 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const Window = opaque {}; +pub const Window = video_api.Window; pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, messageboxError: bool = false, // error dialog messageboxWarning: bool = false, // warning dialog messageboxInformation: bool = false, // informational dialog messageboxButtonsLeftToRight: bool = false, // buttons placed left to right messageboxButtonsRightToLeft: bool = false, // buttons placed right to left - pad0: u26 = 0, + pad1: u22 = 0, rsvd: bool = false, + + pub const None = MessageBoxFlags{}; }; pub const MessageBoxButtonFlags = packed struct(u32) { @@ -18,6 +22,8 @@ pub const MessageBoxButtonFlags = packed struct(u32) { messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit pad0: u29 = 0, rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; }; pub const MessageBoxButtonData = extern struct { @@ -51,14 +57,14 @@ pub const MessageBoxData = extern struct { title: [*c]const u8, // UTF-8 title message: [*c]const u8, // UTF-8 message text numbuttons: c_int, - buttons: *const MessageBoxButtonData, - colorScheme: *const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings }; -pub inline fn showMessageBox(messageboxdata: *const MessageBoxData, buttonid: *c_int) bool { - return c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid)); +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); } pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { - return c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, window); + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); } diff --git a/official/release-3.4.0/api/misc.zig b/official/release-3.4.0/api/misc.zig index 2bcc6d5..c557052 100644 --- a/official/release-3.4.0/api/misc.zig +++ b/official/release-3.4.0/api/misc.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn openURL(url: [*c]const u8) bool { - return c.SDL_OpenURL(url); + return @bitCast(c.SDL_OpenURL(url)); } diff --git a/official/release-3.4.0/api/mouse.zig b/official/release-3.4.0/api/mouse.zig index 5d6a5d0..08095af 100644 --- a/official/release-3.4.0/api/mouse.zig +++ b/official/release-3.4.0/api/mouse.zig @@ -1,35 +1,20 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); -pub const Window = opaque { - pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void { - return c.SDL_WarpMouseInWindow(window, x, y); - } - - pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool { - return c.SDL_SetWindowRelativeMouseMode(window, enabled); - } - - pub inline fn getWindowRelativeMouseMode(window: *Window) bool { - return c.SDL_GetWindowRelativeMouseMode(window); - } -}; - -pub const Surface = opaque { - pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateColorCursor(surface, hot_x, hot_y); - } -}; +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; pub const MouseID = u32; pub const Cursor = opaque { pub inline fn setCursor(cursor: *Cursor) bool { - return c.SDL_SetCursor(cursor); + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); } pub inline fn destroyCursor(cursor: *Cursor) void { - return c.SDL_DestroyCursor(cursor); + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); } }; @@ -73,16 +58,20 @@ pub const MouseButtonFlags = packed struct(u32) { buttonX1: bool = false, pad0: u28 = 0, rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); }; pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; pub inline fn hasMouse() bool { - return c.SDL_HasMouse(); + return @bitCast(c.SDL_HasMouse()); } -pub inline fn getMice(count: *c_int) ?*MouseID { - return c.SDL_GetMice(@ptrCast(count)); +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); } pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { @@ -90,61 +79,77 @@ pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { } pub inline fn getMouseFocus() ?*Window { - return c.SDL_GetMouseFocus(); + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); } -pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); } -pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); } -pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags { - return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y))); +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); } pub inline fn warpMouseGlobal(x: f32, y: f32) bool { - return c.SDL_WarpMouseGlobal(x, y); + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetRelativeMouseTransform(callback, userdata); + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); } pub inline fn captureMouse(enabled: bool) bool { - return c.SDL_CaptureMouse(enabled); + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y); + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); } pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return c.SDL_CreateAnimatedCursor(frames, frame_count, hot_x, hot_y); + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); } pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { - return c.SDL_CreateSystemCursor(id); + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); } pub inline fn getCursor() ?*Cursor { - return c.SDL_GetCursor(); + return @ptrCast(@alignCast(c.SDL_GetCursor())); } pub inline fn getDefaultCursor() ?*Cursor { - return c.SDL_GetDefaultCursor(); + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); } pub inline fn showCursor() bool { - return c.SDL_ShowCursor(); + return @bitCast(c.SDL_ShowCursor()); } pub inline fn hideCursor() bool { - return c.SDL_HideCursor(); + return @bitCast(c.SDL_HideCursor()); } pub inline fn cursorVisible() bool { - return c.SDL_CursorVisible(); + return @bitCast(c.SDL_CursorVisible()); } diff --git a/official/release-3.4.0/api/opengl.zig b/official/release-3.4.0/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.0/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.0/api/pen.zig b/official/release-3.4.0/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.0/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.0/api/pixels.zig b/official/release-3.4.0/api/pixels.zig index 2e298d2..2c7783d 100644 --- a/official/release-3.4.0/api/pixels.zig +++ b/official/release-3.4.0/api/pixels.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PixelType = enum(c_int) { pixeltypeUnknown, pixeltypeIndex1, @@ -58,99 +57,173 @@ pub const PackedLayout = enum(c_int) { }; pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, }; pub const ColorRange = enum(c_int) { - colorRangeLimited, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma - colorRangeFull, + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma }; pub const ColorPrimaries = enum(c_int) { - colorPrimariesBt709, //ITU-R BT.709-6 - colorPrimariesBt470m, //ITU-R BT.470-6 System M - colorPrimariesBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 - colorPrimariesBt601, //ITU-R BT.601-7 525, SMPTE 170M - colorPrimariesSmpte240, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 - colorPrimariesGenericFilm, //Generic film (color filters using Illuminant C) - colorPrimariesBt2020, //ITU-R BT.2020-2 / ITU-R BT.2100-0 - colorPrimariesXyz, //SMPTE ST 428-1 - colorPrimariesSmpte431, //SMPTE RP 431-2 - colorPrimariesSmpte432, //SMPTE EG 432-1 / DCI P3 - colorPrimariesEbu3213, //EBU Tech. 3213-E + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, }; pub const TransferCharacteristics = enum(c_int) { - transferCharacteristicsBt709, //Rec. ITU-R BT.709-6 / ITU-R BT1361 - transferCharacteristicsGamma22, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM - transferCharacteristicsGamma28, //ITU-R BT.470-6 System B, G - transferCharacteristicsBt601, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 - transferCharacteristicsSmpte240, //SMPTE ST 240M - transferCharacteristicsIec61966, //IEC 61966-2-4 - transferCharacteristicsBt1361, //ITU-R BT1361 Extended Colour Gamut - transferCharacteristicsSrgb, //IEC 61966-2-1 (sRGB or sYCC) - transferCharacteristicsBt202010bit, //ITU-R BT2020 for 10-bit system - transferCharacteristicsBt202012bit, //ITU-R BT2020 for 12-bit system - transferCharacteristicsPq, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems - transferCharacteristicsSmpte428, //SMPTE ST 428-1 - transferCharacteristicsHlg, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, }; pub const MatrixCoefficients = enum(c_int) { - matrixCoefficientsBt709, //ITU-R BT.709-6 - matrixCoefficientsFcc, //US FCC Title 47 - matrixCoefficientsBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 - matrixCoefficientsBt601, //ITU-R BT.601-7 525 - matrixCoefficientsSmpte240, //SMPTE 240M - matrixCoefficientsBt2020Ncl, //ITU-R BT.2020-2 non-constant luminance - matrixCoefficientsBt2020Cl, //ITU-R BT.2020-2 constant luminance - matrixCoefficientsSmpte2085, //SMPTE ST 2085 - matrixCoefficientsIctcp, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, }; pub const ChromaLocation = enum(c_int) { - chromaLocationNone, //RGB, no chroma sampling - chromaLocationLeft, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. - chromaLocationCenter, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. - chromaLocationTopleft, + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). }; pub const Colorspace = enum(c_int) { - colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified }; pub const Color = extern struct { @@ -169,7 +242,7 @@ pub const FColor = extern struct { pub const Palette = extern struct { ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. + colors: [*c]Color, // an array of colors, `ncolors` long. version: u32, // internal use only, do not touch. refcount: c_int, // internal use only, do not touch. }; @@ -194,45 +267,45 @@ pub const PixelFormatDetails = extern struct { }; pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { - return c.SDL_GetPixelFormatName(@bitCast(format)); + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); } -pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool { - return c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask)); +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); } pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask)); + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); } -pub inline fn getPixelFormatDetails(format: PixelFormat) *const PixelFormatDetails { - return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format))); +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); } pub inline fn createPalette(ncolors: c_int) ?*Palette { - return c.SDL_CreatePalette(ncolors); + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); } -pub inline fn setPaletteColors(palette: ?*Palette, colors: *const Color, firstcolor: c_int, ncolors: c_int) bool { - return c.SDL_SetPaletteColors(palette, @ptrCast(colors), firstcolor, ncolors); +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); } pub inline fn destroyPalette(palette: ?*Palette) void { - return c.SDL_DestroyPalette(palette); + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); } -pub inline fn mapRGB(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b); +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } -pub inline fn mapRGBA(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } -pub inline fn getRGB(pixelvalue: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b); +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); } -pub inline fn getRGBA(pixelvalue: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b, a); +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); } diff --git a/official/release-3.4.0/api/power.zig b/official/release-3.4.0/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.0/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.0/api/process.zig b/official/release-3.4.0/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.0/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.0/api/properties.zig b/official/release-3.4.0/api/properties.zig index 56e3ac8..5e15c59 100644 --- a/official/release-3.4.0/api/properties.zig +++ b/official/release-3.4.0/api/properties.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const PropertiesID = u32; pub const PropertyType = enum(c_int) { @@ -21,11 +20,11 @@ pub inline fn createProperties() PropertiesID { } pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { - return c.SDL_CopyProperties(src, dst); + return @bitCast(c.SDL_CopyProperties(src, dst)); } pub inline fn lockProperties(props: PropertiesID) bool { - return c.SDL_LockProperties(props); + return @bitCast(c.SDL_LockProperties(props)); } pub inline fn unlockProperties(props: PropertiesID) void { @@ -35,35 +34,35 @@ pub inline fn unlockProperties(props: PropertiesID) void { pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { - return c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata); + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); } pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { - return c.SDL_SetPointerProperty(props, name, value); + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); } pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { - return c.SDL_SetStringProperty(props, name, value); + return @bitCast(c.SDL_SetStringProperty(props, name, value)); } pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { - return c.SDL_SetNumberProperty(props, name, value); + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); } pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { - return c.SDL_SetFloatProperty(props, name, value); + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); } pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { - return c.SDL_SetBooleanProperty(props, name, value); + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); } pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { - return c.SDL_HasProperty(props, name); + return @bitCast(c.SDL_HasProperty(props, name)); } pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { - return @intFromEnum(c.SDL_GetPropertyType(props, name)); + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); } pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { @@ -83,17 +82,17 @@ pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_ } pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { - return c.SDL_GetBooleanProperty(props, name, default_value); + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); } pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { - return c.SDL_ClearProperty(props, name); + return @bitCast(c.SDL_ClearProperty(props, name)); } pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateProperties(props, callback, userdata); + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); } pub inline fn destroyProperties(props: PropertiesID) void { diff --git a/official/release-3.4.0/api/rect.zig b/official/release-3.4.0/api/rect.zig index ab3d595..04d56b0 100644 --- a/official/release-3.4.0/api/rect.zig +++ b/official/release-3.4.0/api/rect.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const Point = extern struct { x: c_int, y: c_int, @@ -25,42 +24,42 @@ pub const FRect = extern struct { h: f32, }; -pub inline fn hasRectIntersection(A: *const Rect, B: *const Rect) bool { - return c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B)); +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } -pub inline fn getRectIntersection(A: *const Rect, B: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectUnion(A: *const Rect, B: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectEnclosingPoints(points: *const Point, count: c_int, clip: *const Rect, result: ?*Rect) bool { - return c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), result); +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersection(rect: *const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool { - return c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2)); +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } -pub inline fn hasRectIntersectionFloat(A: *const FRect, B: *const FRect) bool { - return c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B)); +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); } -pub inline fn getRectIntersectionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectUnionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), result); +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectEnclosingPointsFloat(points: *const FPoint, count: c_int, clip: *const FRect, result: ?*FRect) bool { - return c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), result); +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); } -pub inline fn getRectAndLineIntersectionFloat(rect: *const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool { - return c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2)); +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); } diff --git a/official/release-3.4.0/api/render.zig b/official/release-3.4.0/api/render.zig index c9c211c..1afb792 100644 --- a/official/release-3.4.0/api/render.zig +++ b/official/release-3.4.0/api/render.zig @@ -1,838 +1,107 @@ const std = @import("std"); pub const c = @import("c.zig").c; - -pub const FPoint = extern struct { - x: f32, - y: f32, -}; - -pub const FColor = extern struct { - r: f32, - g: f32, - b: f32, - a: f32, -}; - -pub const Surface = opaque { - pub inline fn createSoftwareRenderer(surface: *Surface) ?*Renderer { - return c.SDL_CreateSoftwareRenderer(surface); - } -}; - -pub const PropertiesID = u32; - -pub const Window = opaque { - pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { - return c.SDL_CreateRenderer(window, name); - } - - pub inline fn getRenderer(window: *Window) ?*Renderer { - return c.SDL_GetRenderer(window); - } -}; - -pub const FRect = extern struct { - x: f32, - y: f32, - w: f32, - h: f32, -}; - -pub const GPUTextureSamplerBinding = extern struct { - texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. - sampler: ?*GPUSampler, // The sampler to bind. -}; - -pub const GPUSampler = opaque {}; - -pub const GPUTexture = opaque {}; - -pub const GPUShader = opaque {}; - -pub const WindowFlags = packed struct(u64) { - windowFullscreen: bool = false, // window is in fullscreen mode - windowOpengl: bool = false, // window usable with OpenGL context - windowOccluded: bool = false, // window is occluded - windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible - windowBorderless: bool = false, // no window decoration - windowResizable: bool = false, // window can be resized - windowMinimized: bool = false, // window is minimized - windowMaximized: bool = false, // window is maximized - windowMouseGrabbed: bool = false, // window has grabbed mouse input - windowInputFocus: bool = false, // window has input focus - windowMouseFocus: bool = false, // window has mouse focus - windowExternal: bool = false, // window not created by SDL - windowModal: bool = false, // window is modal - windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible - windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) - windowMouseRelativeMode: bool = false, // window has relative mode enabled - windowAlwaysOnTop: bool = false, // window should always be above others - windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list - windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window - windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window - windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input - windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 - windowVulkan: bool = false, // window usable for Vulkan surface - windowMetal: bool = false, // window usable for Metal view - windowTransparent: bool = false, // window with transparent buffer - windowNotFocusable: bool = false, // window should not be focusable - pad0: u37 = 0, - rsvd: bool = false, -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering - scalemodePixelart, -}; - -pub const GPUDevice = opaque { - pub inline fn createGPURenderer(gpudevice: *GPUDevice, window: ?*Window) ?*Renderer { - return c.SDL_CreateGPURenderer(gpudevice, window); - } -}; - -pub const BlendMode = u32; - -pub const Event = extern union { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - common: CommonEvent, // Common event data - display: DisplayEvent, // Display event data - window: WindowEvent, // Window event data - kdevice: KeyboardDeviceEvent, // Keyboard device change event data - key: KeyboardEvent, // Keyboard event data - edit: TextEditingEvent, // Text editing event data - edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data - text: TextInputEvent, // Text input event data - mdevice: MouseDeviceEvent, // Mouse device change event data - motion: MouseMotionEvent, // Mouse motion event data - button: MouseButtonEvent, // Mouse button event data - wheel: MouseWheelEvent, // Mouse wheel event data - jdevice: JoyDeviceEvent, // Joystick device change event data - jaxis: JoyAxisEvent, // Joystick axis event data - jball: JoyBallEvent, // Joystick ball event data - jhat: JoyHatEvent, // Joystick hat event data - jbutton: JoyButtonEvent, // Joystick button event data - jbattery: JoyBatteryEvent, // Joystick battery event data - gdevice: GamepadDeviceEvent, // Gamepad device event data - gaxis: GamepadAxisEvent, // Gamepad axis event data - gbutton: GamepadButtonEvent, // Gamepad button event data - gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data - gsensor: GamepadSensorEvent, // Gamepad sensor event data - adevice: AudioDeviceEvent, // Audio device event data - cdevice: CameraDeviceEvent, // Camera device event data - sensor: SensorEvent, // Sensor event data - quit: QuitEvent, // Quit request event data - user: UserEvent, // Custom event data - tfinger: TouchFingerEvent, // Touch finger event data - pinch: PinchFingerEvent, // Pinch event data - pproximity: PenProximityEvent, // Pen proximity event data - ptouch: PenTouchEvent, // Pen tip touching event data - pmotion: PenMotionEvent, // Pen motion event data - pbutton: PenButtonEvent, // Pen button event data - paxis: PenAxisEvent, // Pen axis event data - render: RenderEvent, // Render event data - drop: DropEvent, // Drag and drop event data - clipboard: ClipboardEvent, // Clipboard event data - padding: [128]u8, -}; - -pub const JoyAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The joystick axis index - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window if any - code: i32, // User defined event code - data1: ?*anyopaque, // User defined data pointer - data2: ?*anyopaque, // User defined data pointer -}; - -pub const PinchFingerEvent = extern struct { - _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const MouseMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - state: MouseButtonFlags, // The current button state - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - xrel: f32, // The relative motion in the X direction - yrel: f32, // The relative motion in the Y direction -}; - -pub const CommonEvent = extern struct { - _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const GamepadButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The gamepad button (SDL_GamepadButton) - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const JoyDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const GamepadTouchpadEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - touchpad: i32, // The index of the touchpad - finger: i32, // The index of the finger on the touchpad - x: f32, // Normalized in the range 0...1 with 0 being on the left - y: f32, // Normalized in the range 0...1 with 0 being at the top - pressure: f32, // Normalized in the range 0...1 -}; - -pub const GamepadSensorEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - sensor: i32, // The type of the sensor, one of the values of SDL_SensorType - data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const RenderEvent = extern struct { - _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window containing the renderer in question. -}; - -pub const ClipboardEvent = extern struct { - _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - owner: bool, // are we owning the clipboard (internal update) - num_mime_types: i32, // number of mime types - mime_types: [*c][*c]const u8, // current mime types -}; - -pub const PenMotionEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const GamepadAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - axis: u8, // The gamepad axis (SDL_GamepadAxis) - padding1: u8, - padding2: u8, - padding3: u8, - value: i16, // The axis value (range: -32768 to 32767) - padding4: u16, -}; - -pub const DisplayEvent = extern struct { - _type: EventType, // SDL_EVENT_DISPLAY_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - displayID: DisplayID, // The associated display - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const DropEvent = extern struct { - _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window that was dropped on, if any - x: f32, // X coordinate, relative to window (not on begin) - y: f32, // Y coordinate, relative to window (not on begin) - source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available - data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events -}; - -pub const CameraDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: CameraID, // SDL_CameraID for the device being added or removed or changing -}; - -pub const KeyboardDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: KeyboardID, // The keyboard instance id -}; - -pub const JoyBatteryEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - state: PowerState, // The joystick battery state - percent: c_int, // The joystick battery percent charge remaining -}; - -pub const TouchFingerEvent = extern struct { - _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - touchID: TouchID, // The touch device id - fingerID: FingerID, - x: f32, // Normalized in the range 0...1 - y: f32, // Normalized in the range 0...1 - dx: f32, // Normalized in the range -1...1 - dy: f32, // Normalized in the range -1...1 - pressure: f32, // Normalized in the range 0...1 - windowID: WindowID, // The window underneath the finger, if any -}; - -pub const SensorEvent = extern struct { - _type: EventType, // SDL_EVENT_SENSOR_UPDATE - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: SensorID, // The instance ID of the sensor - data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() - sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock -}; - -pub const TextEditingEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The editing text - start: i32, // The start cursor of selected editing text, or -1 if not set - length: i32, // The length of selected editing text, or -1 if not set -}; - -pub const JoyHatEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - hat: u8, // The joystick hat index - padding1: u8, - padding2: u8, -}; - -pub const QuitEvent = extern struct { - _type: EventType, // SDL_EVENT_QUIT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() -}; - -pub const PenProximityEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id -}; - -pub const WindowEvent = extern struct { - _type: EventType, // SDL_EVENT_WINDOW_* - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The associated window - data1: i32, // event dependent data - data2: i32, // event dependent data -}; - -pub const PenTouchEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - eraser: bool, // true if eraser end is used (not all pens support this). - down: bool, // true if the pen is touching or false if the pen is lifted off -}; - -pub const PenButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - button: u8, // The pen button index (first button is 1). - down: bool, // true if the button is pressed -}; - -pub const GamepadDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id -}; - -pub const JoyBallEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - ball: u8, // The joystick trackball index - padding1: u8, - padding2: u8, - padding3: u8, - xrel: i16, // The relative motion in the X direction - yrel: i16, // The relative motion in the Y direction -}; - -pub const AudioDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing - recording: bool, // false if a playback device, true if a recording device. - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const MouseWheelEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_WHEEL - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode or 0 - x: f32, // The amount scrolled horizontally, positive to the right and negative to the left - y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user - direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back - mouse_x: f32, // X coordinate, relative to window - mouse_y: f32, // Y coordinate, relative to window - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) -}; - -pub const PenAxisEvent = extern struct { - _type: EventType, // SDL_EVENT_PEN_AXIS - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with pen focus, if any - which: PenID, // The pen instance id - pen_state: PenInputFlags, // Complete pen input state at time of event - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window - axis: PenAxis, // Axis that has changed - value: f32, // New value of axis -}; - -pub const MouseDeviceEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: MouseID, // The mouse instance id -}; - -pub const JoyButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - which: JoystickID, // The joystick instance id - button: u8, // The joystick button index - down: bool, // true if the button is pressed - padding1: u8, - padding2: u8, -}; - -pub const MouseButtonEvent = extern struct { - _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with mouse focus, if any - which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 - button: u8, // The mouse button index - down: bool, // true if the button is pressed - clicks: u8, // 1 for single-click, 2 for double-click, etc. - padding: u8, - x: f32, // X coordinate, relative to window - y: f32, // Y coordinate, relative to window -}; - -pub const KeyboardEvent = extern struct { - _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual - scancode: Scancode, // SDL physical key code - key: Keycode, // SDL virtual key code - mod: Keymod, // current key modifiers - raw: u16, // The platform dependent scancode for this event - down: bool, // true if the key is pressed - repeat: bool, // true if this is a key repeat -}; - -pub const TextEditingCandidatesEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available - num_candidates: i32, // The number of strings in `candidates` - selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected - horizontal: bool, // true if the list is horizontal, false if it's vertical - padding1: u8, - padding2: u8, - padding3: u8, -}; - -pub const TextInputEvent = extern struct { - _type: EventType, // SDL_EVENT_TEXT_INPUT - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - windowID: WindowID, // The window with keyboard focus, if any - text: [*c]const u8, // The input text, UTF-8 encoded -}; - -pub const EventType = enum(c_int) { - eventFirst, //Unused (do not remove) - eventQuit, //User-requested quit - eventTerminating, - eventLowMemory, - eventWillEnterBackground, - eventDidEnterBackground, - eventWillEnterForeground, - eventDidEnterForeground, - eventLocaleChanged, //The user's locale preferences have changed. - eventSystemThemeChanged, //The system theme changed - eventDisplayOrientation, //Display orientation has changed to data1 - eventDisplayAdded, //Display has been added to the system - eventDisplayRemoved, //Display has been removed from the system - eventDisplayMoved, //Display has changed position - eventDisplayDesktopModeChanged, //Display has changed desktop mode - eventDisplayCurrentModeChanged, //Display has changed current mode - eventDisplayContentScaleChanged, //Display has changed content scale - eventDisplayUsableBoundsChanged, //Display has changed usable bounds - eventWindowShown, //Window has been shown - eventWindowHidden, //Window has been hidden - eventWindowExposed, - eventWindowMoved, //Window has been moved to data1, data2 - eventWindowResized, //Window has been resized to data1xdata2 - eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 - eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed - eventWindowMinimized, //Window has been minimized - eventWindowMaximized, //Window has been maximized - eventWindowRestored, //Window has been restored to normal size and position - eventWindowMouseEnter, //Window has gained mouse focus - eventWindowMouseLeave, //Window has lost mouse focus - eventWindowFocusGained, //Window has gained keyboard focus - eventWindowFocusLost, //Window has lost keyboard focus - eventWindowCloseRequested, //The window manager requests that the window be closed - eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL - eventWindowIccprofChanged, //The ICC profile of the window's display has changed - eventWindowDisplayChanged, //Window has been moved to display data1 - eventWindowDisplayScaleChanged, //Window display scale has been changed - eventWindowSafeAreaChanged, //The window safe area has been changed - eventWindowOccluded, //The window has been occluded - eventWindowEnterFullscreen, //The window has entered fullscreen mode - eventWindowLeaveFullscreen, //The window has left fullscreen mode - eventWindowDestroyed, - eventWindowHdrStateChanged, //Window HDR properties have changed - eventKeyDown, //Key pressed - eventKeyUp, //Key released - eventTextEditing, //Keyboard text editing (composition) - eventTextInput, //Keyboard text input - eventKeymapChanged, - eventKeyboardAdded, //A new keyboard has been inserted into the system - eventKeyboardRemoved, //A keyboard has been removed - eventTextEditingCandidates, //Keyboard text editing candidates - eventScreenKeyboardShown, //The on-screen keyboard has been shown - eventScreenKeyboardHidden, //The on-screen keyboard has been hidden - eventMouseMotion, //Mouse moved - eventMouseButtonDown, //Mouse button pressed - eventMouseButtonUp, //Mouse button released - eventMouseWheel, //Mouse wheel motion - eventMouseAdded, //A new mouse has been inserted into the system - eventMouseRemoved, //A mouse has been removed - eventJoystickAxisMotion, //Joystick axis motion - eventJoystickBallMotion, //Joystick trackball motion - eventJoystickHatMotion, //Joystick hat position change - eventJoystickButtonDown, //Joystick button pressed - eventJoystickButtonUp, //Joystick button released - eventJoystickAdded, //A new joystick has been inserted into the system - eventJoystickRemoved, //An opened joystick has been removed - eventJoystickBatteryUpdated, //Joystick battery level change - eventJoystickUpdateComplete, //Joystick update is complete - eventGamepadAxisMotion, //Gamepad axis motion - eventGamepadButtonDown, //Gamepad button pressed - eventGamepadButtonUp, //Gamepad button released - eventGamepadAdded, //A new gamepad has been inserted into the system - eventGamepadRemoved, //A gamepad has been removed - eventGamepadRemapped, //The gamepad mapping was updated - eventGamepadTouchpadDown, //Gamepad touchpad was touched - eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved - eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted - eventGamepadSensorUpdate, //Gamepad sensor was updated - eventGamepadUpdateComplete, //Gamepad update is complete - eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed - eventFingerUp, - eventFingerMotion, - eventFingerCanceled, - eventPinchBegin, //Pinch gesture started - eventPinchUpdate, //Pinch gesture updated - eventPinchEnd, //Pinch gesture ended - eventClipboardUpdate, //The clipboard changed - eventDropFile, //The system requests a file open - eventDropText, //text/plain drag-and-drop event - eventDropBegin, //A new set of drops is beginning (NULL filename) - eventDropComplete, //Current set of drops is now complete (NULL filename) - eventDropPosition, //Position while moving over the window - eventAudioDeviceAdded, //A new audio device is available - eventAudioDeviceRemoved, //An audio device has been removed. - eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. - eventSensorUpdate, //A sensor was updated - eventPenProximityIn, //Pressure-sensitive pen has become available - eventPenProximityOut, //Pressure-sensitive pen has become unavailable - eventPenDown, //Pressure-sensitive pen touched drawing surface - eventPenUp, //Pressure-sensitive pen stopped touching drawing surface - eventPenButtonDown, //Pressure-sensitive pen button pressed - eventPenButtonUp, //Pressure-sensitive pen button released - eventPenMotion, //Pressure-sensitive pen is moving on the tablet - eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed - eventCameraDeviceAdded, //A new camera device is available - eventCameraDeviceRemoved, //A camera device has been removed. - eventCameraDeviceApproved, //A camera device has been approved for use by the user. - eventCameraDeviceDenied, //A camera device has been denied for use by the user. - eventRenderTargetsReset, //The render targets have been reset and their contents need to be updated - eventRenderDeviceReset, //The device has been reset and all textures need to be recreated - eventRenderDeviceLost, //The device has been lost and can't be recovered. - eventPrivate1, - eventPrivate2, - eventPrivate3, - eventPollSentinel, //Signals the end of an event poll cycle -}; - -pub const JoystickID = u32; - -pub const WindowID = u32; - -pub const MouseID = u32; - -pub const MouseButtonFlags = packed struct(u32) { - buttonLeft: bool = false, - buttonMiddle: bool = false, - buttonX1: bool = false, - pad0: u28 = 0, - rsvd: bool = false, -}; - -pub const PenInputFlags = packed struct(u32) { - penInputDown: bool = false, // pen is pressed down - penInputButton1: bool = false, // button 1 is pressed - penInputButton2: bool = false, // button 2 is pressed - penInputButton3: bool = false, // button 3 is pressed - penInputButton4: bool = false, // button 4 is pressed - penInputButton5: bool = false, // button 5 is pressed - penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, - rsvd: bool = false, -}; - -pub const PenID = u32; - -pub const DisplayID = u32; - -pub const CameraID = u32; - -pub const KeyboardID = u32; - -pub const PowerState = enum(c_int) { - powerstateError, //error determining power status - powerstateUnknown, //cannot determine power status - powerstateOnBattery, //Not plugged in, running on the battery - powerstateNoBattery, //Plugged in, no battery available - powerstateCharging, //Plugged in, charging battery - powerstateCharged, -}; - -pub const TouchID = u64; - -pub const FingerID = u64; - -pub const SensorID = u32; - -pub const AudioDeviceID = u32; - -pub const MouseWheelDirection = enum(c_int) { - mousewheelNormal, //The scroll direction is normal - mousewheelFlipped, //The scroll direction is flipped / natural -}; - -pub const PenAxis = enum(c_int) { - penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 - penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). - penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). - penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 - penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). - penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 - penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). - penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! -}; - -pub const Scancode = enum(c_int) { - scancodeBackslash, - scancodeNonushash, - scancodeGrave, - scancodeInsert, - scancodeNumlockclear, - scancodeNonusbackslash, - scancodeApplication, //windows contextual menu, compose - scancodePower, - scancodeHelp, //AL Integrated Help Center - scancodeMenu, //Menu (show menu) - scancodeStop, //AC Stop - scancodeAgain, //AC Redo/Repeat - scancodeUndo, //AC Undo - scancodeCut, //AC Cut - scancodeCopy, //AC Copy - scancodePaste, //AC Paste - scancodeFind, //AC Find - scancodeInternational1, - scancodeInternational3, //Yen - scancodeLang1, //Hangul/English toggle - scancodeLang2, //Hanja conversion - scancodeLang3, //Katakana - scancodeLang4, //Hiragana - scancodeLang5, //Zenkaku/Hankaku - scancodeLang6, //reserved - scancodeLang7, //reserved - scancodeLang8, //reserved - scancodeLang9, //reserved - scancodeAlterase, //Erase-Eaze - scancodeCancel, //AC Cancel - scancodeLalt, //alt, option - scancodeLgui, //windows, command (apple), meta - scancodeRalt, //alt gr, option - scancodeRgui, //windows, command (apple), meta - scancodeMode, - scancodeSleep, //Sleep - scancodeWake, //Wake - scancodeChannelIncrement, //Channel Increment - scancodeChannelDecrement, //Channel Decrement - scancodeMediaPlay, //Play - scancodeMediaPause, //Pause - scancodeMediaRecord, //Record - scancodeMediaFastForward, //Fast Forward - scancodeMediaRewind, //Rewind - scancodeMediaNextTrack, //Next Track - scancodeMediaPreviousTrack, //Previous Track - scancodeMediaStop, //Stop - scancodeMediaEject, //Eject - scancodeMediaPlayPause, //Play / Pause - scancodeMediaSelect, - scancodeAcNew, //AC New - scancodeAcOpen, //AC Open - scancodeAcClose, //AC Close - scancodeAcExit, //AC Exit - scancodeAcSave, //AC Save - scancodeAcPrint, //AC Print - scancodeAcProperties, //AC Properties - scancodeAcSearch, //AC Search - scancodeAcHome, //AC Home - scancodeAcBack, //AC Back - scancodeAcForward, //AC Forward - scancodeAcStop, //AC Stop - scancodeAcRefresh, //AC Refresh - scancodeAcBookmarks, //AC Bookmarks - scancodeSoftleft, - scancodeSoftright, - scancodeCall, //Used for accepting phone calls. - scancodeEndcall, //Used for rejecting phone calls. - scancodeReserved, //400-500 reserved for dynamic keycodes - scancodeCount, -}; - -pub const Keymod = u16; - -pub const Keycode = u32; - -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical, //flip horizontally and vertically (not a diagonal flip) -}; - -pub const GPUBuffer = opaque {}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; }; pub const Vertex = extern struct { @@ -848,6 +117,7 @@ pub const TextureAccess = enum(c_int) { }; pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range textureAddressWrap, //The texture is repeated (tiled) @@ -863,369 +133,369 @@ pub const RendererLogicalPresentation = enum(c_int) { pub const Renderer = opaque { pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { - return c.SDL_GetGPURendererDevice(renderer); + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); } pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { - return c.SDL_GetRenderWindow(renderer); + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); } pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { - return c.SDL_GetRendererName(renderer); + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); } pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { - return c.SDL_GetRendererProperties(renderer); + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); } - pub inline fn getRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return c.SDL_GetRenderOutputSize(renderer, @ptrCast(w), @ptrCast(h)); + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } - pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: *c_int, h: *c_int) bool { - return c.SDL_GetCurrentRenderOutputSize(renderer, @ptrCast(w), @ptrCast(h)); + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); } pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { - return c.SDL_CreateTexture(renderer, @bitCast(format), access, w, h); + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); } pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { - return c.SDL_CreateTextureFromSurface(renderer, surface); + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); } pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { - return c.SDL_CreateTextureWithProperties(renderer, props); + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); } pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { - return c.SDL_SetRenderTarget(renderer, texture); + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); } pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { - return c.SDL_GetRenderTarget(renderer); + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); } pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { - return c.SDL_SetRenderLogicalPresentation(renderer, w, h, mode); + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); } - pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: *c_int, h: *c_int, mode: ?*RendererLogicalPresentation) bool { - return c.SDL_GetRenderLogicalPresentation(renderer, @ptrCast(w), @ptrCast(h), mode); + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); } pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { - return c.SDL_GetRenderLogicalPresentationRect(renderer, rect); + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: *f32, y: *f32) bool { - return c.SDL_RenderCoordinatesFromWindow(renderer, window_x, window_y, @ptrCast(x), @ptrCast(y)); + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); } - pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: *f32, window_y: *f32) bool { - return c.SDL_RenderCoordinatesToWindow(renderer, x, y, @ptrCast(window_x), @ptrCast(window_y)); + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); } pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { - return c.SDL_ConvertEventToRenderCoordinates(renderer, event); + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); } - pub inline fn setRenderViewport(renderer: *Renderer, rect: *const Rect) bool { - return c.SDL_SetRenderViewport(renderer, @ptrCast(rect)); + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderViewport(renderer, rect); + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderViewportSet(renderer: *Renderer) bool { - return c.SDL_RenderViewportSet(renderer); + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderSafeArea(renderer, rect); + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn setRenderClipRect(renderer: *Renderer, rect: *const Rect) bool { - return c.SDL_SetRenderClipRect(renderer, @ptrCast(rect)); + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { - return c.SDL_GetRenderClipRect(renderer, rect); + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } pub inline fn renderClipEnabled(renderer: *Renderer) bool { - return c.SDL_RenderClipEnabled(renderer); + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); } pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { - return c.SDL_SetRenderScale(renderer, scaleX, scaleY); + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } - pub inline fn getRenderScale(renderer: *Renderer, scaleX: *f32, scaleY: *f32) bool { - return c.SDL_GetRenderScale(renderer, @ptrCast(scaleX), @ptrCast(scaleY)); + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); } pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { - return c.SDL_SetRenderDrawColor(renderer, r, g, b, a); + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_SetRenderDrawColorFloat(renderer, r, g, b, a); + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return c.SDL_GetRenderDrawColor(renderer, r, g, b, a); + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); } - pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return c.SDL_GetRenderDrawColorFloat(renderer, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a)); + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); } pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { - return c.SDL_SetRenderColorScale(renderer, scale); + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } - pub inline fn getRenderColorScale(renderer: *Renderer, scale: *f32) bool { - return c.SDL_GetRenderColorScale(renderer, @ptrCast(scale)); + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); } pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { - return c.SDL_SetRenderDrawBlendMode(renderer, @intFromEnum(blendMode)); + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { - return c.SDL_GetRenderDrawBlendMode(renderer, @intFromEnum(blendMode)); + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); } pub inline fn renderClear(renderer: *Renderer) bool { - return c.SDL_RenderClear(renderer); + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); } pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { - return c.SDL_RenderPoint(renderer, x, y); + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); } - pub inline fn renderPoints(renderer: *Renderer, points: *const FPoint, count: c_int) bool { - return c.SDL_RenderPoints(renderer, @ptrCast(points), count); + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { - return c.SDL_RenderLine(renderer, x1, y1, x2, y2); + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); } - pub inline fn renderLines(renderer: *Renderer, points: *const FPoint, count: c_int) bool { - return c.SDL_RenderLines(renderer, @ptrCast(points), count); + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); } - pub inline fn renderRect(renderer: *Renderer, rect: *const FRect) bool { - return c.SDL_RenderRect(renderer, @ptrCast(rect)); + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderRects(renderer: *Renderer, rects: *const FRect, count: c_int) bool { - return c.SDL_RenderRects(renderer, @ptrCast(rects), count); + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } - pub inline fn renderFillRect(renderer: *Renderer, rect: *const FRect) bool { - return c.SDL_RenderFillRect(renderer, @ptrCast(rect)); + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); } - pub inline fn renderFillRects(renderer: *Renderer, rects: *const FRect, count: c_int) bool { - return c.SDL_RenderFillRects(renderer, @ptrCast(rects), count); + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); } - pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, dstrect: *const FRect) bool { - return c.SDL_RenderTexture(renderer, texture, @ptrCast(srcrect), @ptrCast(dstrect)); + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); } - pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, dstrect: *const FRect, angle: f64, center: *const FPoint, flip: FlipMode) bool { - return c.SDL_RenderTextureRotated(renderer, texture, @ptrCast(srcrect), @ptrCast(dstrect), angle, @ptrCast(center), @intFromEnum(flip)); + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); } - pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, origin: *const FPoint, right: *const FPoint, down: *const FPoint) bool { - return c.SDL_RenderTextureAffine(renderer, texture, @ptrCast(srcrect), @ptrCast(origin), @ptrCast(right), @ptrCast(down)); + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); } - pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, scale: f32, dstrect: *const FRect) bool { - return c.SDL_RenderTextureTiled(renderer, texture, @ptrCast(srcrect), scale, @ptrCast(dstrect)); + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); } - pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: *const FRect) bool { - return c.SDL_RenderTexture9Grid(renderer, texture, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect)); + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); } - pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: *const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: *const FRect, tileScale: f32) bool { - return c.SDL_RenderTexture9GridTiled(renderer, texture, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect), tileScale); + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); } - pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: *const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { - return c.SDL_RenderGeometry(renderer, texture, @ptrCast(vertices), num_vertices, indices, num_indices); + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); } - pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: *const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { - return c.SDL_RenderGeometryRaw(renderer, texture, @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices); + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); } pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { - return c.SDL_SetRenderTextureAddressMode(renderer, @intFromEnum(u_mode), @intFromEnum(v_mode)); + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); } pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { - return c.SDL_GetRenderTextureAddressMode(renderer, @intFromEnum(u_mode), @intFromEnum(v_mode)); + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); } - pub inline fn renderReadPixels(renderer: *Renderer, rect: *const Rect) ?*Surface { - return c.SDL_RenderReadPixels(renderer, @ptrCast(rect)); + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); } pub inline fn renderPresent(renderer: *Renderer) bool { - return c.SDL_RenderPresent(renderer); + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); } pub inline fn destroyRenderer(renderer: *Renderer) void { - return c.SDL_DestroyRenderer(renderer); + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); } pub inline fn flushRenderer(renderer: *Renderer) bool { - return c.SDL_FlushRenderer(renderer); + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); } pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalLayer(renderer); + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); } pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { - return c.SDL_GetRenderMetalCommandEncoder(renderer); + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); } pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { - return c.SDL_AddVulkanRenderSemaphores(renderer, wait_stage_mask, wait_semaphore, signal_semaphore); + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); } pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { - return c.SDL_SetRenderVSync(renderer, vsync); + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } - pub inline fn getRenderVSync(renderer: *Renderer, vsync: *c_int) bool { - return c.SDL_GetRenderVSync(renderer, @ptrCast(vsync)); + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); } pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { - return c.SDL_RenderDebugText(renderer, x, y, str); + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); } pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { - return c.SDL_SetDefaultTextureScaleMode(renderer, @intFromEnum(scale_mode)); + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); } pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { - return c.SDL_GetDefaultTextureScaleMode(renderer, @intFromEnum(scale_mode)); + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); } pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*GPURenderStateCreateInfo) ?*GPURenderState { - return c.SDL_CreateGPURenderState(renderer, createinfo); + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); } pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { - return c.SDL_SetGPURenderState(renderer, state); + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); } }; pub const Texture = opaque { pub inline fn getTextureProperties(texture: *Texture) PropertiesID { - return c.SDL_GetTextureProperties(texture); + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); } pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { - return c.SDL_GetRendererFromTexture(texture); + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); } - pub inline fn getTextureSize(texture: *Texture, w: *f32, h: *f32) bool { - return c.SDL_GetTextureSize(texture, @ptrCast(w), @ptrCast(h)); + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); } pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { - return c.SDL_SetTexturePalette(texture, palette); + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); } pub inline fn getTexturePalette(texture: *Texture) ?*Palette { - return c.SDL_GetTexturePalette(texture); + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); } pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { - return c.SDL_SetTextureColorMod(texture, r, g, b); + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { - return c.SDL_SetTextureColorModFloat(texture, r, g, b); + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return c.SDL_GetTextureColorMod(texture, r, g, b); + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); } - pub inline fn getTextureColorModFloat(texture: *Texture, r: *f32, g: *f32, b: *f32) bool { - return c.SDL_GetTextureColorModFloat(texture, @ptrCast(r), @ptrCast(g), @ptrCast(b)); + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); } pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { - return c.SDL_SetTextureAlphaMod(texture, alpha); + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { - return c.SDL_SetTextureAlphaModFloat(texture, alpha); + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { - return c.SDL_GetTextureAlphaMod(texture, alpha); + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); } - pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: *f32) bool { - return c.SDL_GetTextureAlphaModFloat(texture, @ptrCast(alpha)); + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); } pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { - return c.SDL_SetTextureBlendMode(texture, @intFromEnum(blendMode)); + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { - return c.SDL_GetTextureBlendMode(texture, @intFromEnum(blendMode)); + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); } pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { - return c.SDL_SetTextureScaleMode(texture, @intFromEnum(scaleMode)); + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); } pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { - return c.SDL_GetTextureScaleMode(texture, @intFromEnum(scaleMode)); + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); } - pub inline fn updateTexture(texture: *Texture, rect: *const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { - return c.SDL_UpdateTexture(texture, @ptrCast(rect), pixels, pitch); + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } - pub inline fn updateYUVTexture(texture: *Texture, rect: *const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { - return c.SDL_UpdateYUVTexture(texture, @ptrCast(rect), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch); + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); } - pub inline fn updateNVTexture(texture: *Texture, rect: *const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { - return c.SDL_UpdateNVTexture(texture, @ptrCast(rect), Yplane, Ypitch, UVplane, UVpitch); + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); } - pub inline fn lockTexture(texture: *Texture, rect: *const Rect, pixels: [*c]?*anyopaque, pitch: *c_int) bool { - return c.SDL_LockTexture(texture, @ptrCast(rect), pixels, @ptrCast(pitch)); + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); } - pub inline fn lockTextureToSurface(texture: *Texture, rect: *const Rect, surface: [*c][*c]Surface) bool { - return c.SDL_LockTextureToSurface(texture, @ptrCast(rect), surface); + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); } pub inline fn unlockTexture(texture: *Texture) void { - return c.SDL_UnlockTexture(texture); + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); } pub inline fn destroyTexture(texture: *Texture) void { - return c.SDL_DestroyTexture(texture); + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); } }; @@ -1237,31 +507,47 @@ pub inline fn getRenderDriver(index: c_int) [*c]const u8 { return c.SDL_GetRenderDriver(index); } -pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c][*c]Window, renderer: [*c][*c]Renderer) bool { - return c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), window, renderer); +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); } pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { - return c.SDL_CreateRendererWithProperties(props); + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); } pub const GPURenderStateCreateInfo = extern struct { fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active - sampler_bindings: *const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active num_storage_textures: i32, // The number of storage textures to bind when this render state is active - storage_textures: [*c]*const GPUTexture, // Storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active - storage_buffers: [*c]*const GPUBuffer, // Storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. }; pub const GPURenderState = opaque { pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { - return c.SDL_SetGPURenderStateFragmentUniforms(gpurenderstate, slot_index, data, length); + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); } pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { - return c.SDL_DestroyGPURenderState(gpurenderstate); + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); } }; diff --git a/official/release-3.4.0/api/scancode.zig b/official/release-3.4.0/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.0/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.0/api/sensor.zig b/official/release-3.4.0/api/sensor.zig index 38e74f0..f471675 100644 --- a/official/release-3.4.0/api/sensor.zig +++ b/official/release-3.4.0/api/sensor.zig @@ -1,42 +1,43 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); -pub const PropertiesID = u32; +pub const PropertiesID = properties_api.PropertiesID; pub const Sensor = opaque { pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { - return c.SDL_GetSensorProperties(sensor); + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { - return c.SDL_GetSensorName(sensor); + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorType(sensor: *Sensor) SensorType { - return @intFromEnum(c.SDL_GetSensorType(sensor)); + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); } pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { - return c.SDL_GetSensorNonPortableType(sensor); + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); } pub inline fn getSensorID(sensor: *Sensor) SensorID { - return c.SDL_GetSensorID(sensor); + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); } - pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool { - return c.SDL_GetSensorData(sensor, @ptrCast(data), num_values); + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); } pub inline fn closeSensor(sensor: *Sensor) void { - return c.SDL_CloseSensor(sensor); + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); } }; pub const SensorID = u32; pub const SensorType = enum(c_int) { - sensorInvalid, //Returned for an invalid sensor + sensorInvalid = -1, //Returned for an invalid sensor sensorUnknown, //Unknown sensor type sensorAccel, //Accelerometer sensorGyro, //Gyroscope @@ -47,8 +48,8 @@ pub const SensorType = enum(c_int) { sensorCount, }; -pub inline fn getSensors(count: *c_int) ?*SensorID { - return c.SDL_GetSensors(@ptrCast(count)); +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); } pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { @@ -56,7 +57,7 @@ pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { } pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { - return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id)); + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); } pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { @@ -64,11 +65,11 @@ pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { } pub inline fn openSensor(instance_id: SensorID) ?*Sensor { - return c.SDL_OpenSensor(instance_id); + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); } pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { - return c.SDL_GetSensorFromID(instance_id); + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); } pub inline fn updateSensors() void { diff --git a/official/release-3.4.0/api/stdinc.zig b/official/release-3.4.0/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.0/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.0/api/storage.zig b/official/release-3.4.0/api/storage.zig index 37100c3..702db88 100644 --- a/official/release-3.4.0/api/storage.zig +++ b/official/release-3.4.0/api/storage.zig @@ -1,114 +1,97 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); -pub const PathInfo = extern struct { - _type: PathType, // the path type - size: u64, // the file size in bytes - create_time: Time, // the time when the path was created - modify_time: Time, // the last time the path was modified - access_time: Time, // the last time the path was read -}; - -pub const PathType = enum(c_int) { - pathtypeNone, //path does not exist - pathtypeFile, //a normal file - pathtypeDirectory, //a directory - pathtypeOther, -}; - -pub const Time = i64; - -pub const GlobFlags = packed struct(u32) { - globCaseinsensitive: bool = false, - pad0: u30 = 0, - rsvd: bool = false, -}; - -pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; - -pub const PropertiesID = u32; +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; pub const StorageInterface = extern struct { version: u32, - close: ?*const anyopaque, - ready: ?*const anyopaque, - enumerate: ?*const anyopaque, - info: ?*const anyopaque, - read_file: ?*const anyopaque, - write_file: ?*const anyopaque, - mkdir: ?*const anyopaque, - remove: ?*const anyopaque, - rename: ?*const anyopaque, - copy: ?*const anyopaque, - space_remaining: ?*const anyopaque, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, }; pub const Storage = opaque { pub inline fn closeStorage(storage: *Storage) bool { - return c.SDL_CloseStorage(storage); + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); } pub inline fn storageReady(storage: *Storage) bool { - return c.SDL_StorageReady(storage); + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); } - pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool { - return c.SDL_GetStorageFileSize(storage, path, @ptrCast(length)); + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); } pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { - return c.SDL_ReadStorageFile(storage, path, destination, length); + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); } pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { - return c.SDL_WriteStorageFile(storage, path, source, length); + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); } pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { - return c.SDL_CreateStorageDirectory(storage, path); + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); } pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { - return c.SDL_EnumerateStorageDirectory(storage, path, callback, userdata); + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); } pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { - return c.SDL_RemoveStoragePath(storage, path); + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); } pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_RenameStoragePath(storage, oldpath, newpath); + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { - return c.SDL_CopyStorageFile(storage, oldpath, newpath); + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); } pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { - return c.SDL_GetStoragePathInfo(storage, path, info); + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); } pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { - return c.SDL_GetStorageSpaceRemaining(storage); + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); } - pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 { - return c.SDL_GlobStorageDirectory(storage, path, pattern, @bitCast(flags), @ptrCast(count)); + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); } }; pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { - return c.SDL_OpenTitleStorage(override, props); + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); } pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { - return c.SDL_OpenUserStorage(org, app, props); + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); } pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { - return c.SDL_OpenFileStorage(path); + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); } -pub inline fn openStorage(iface: *const StorageInterface, userdata: ?*anyopaque) ?*Storage { - return c.SDL_OpenStorage(@ptrCast(iface), userdata); +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); } diff --git a/official/release-3.4.0/api/surface.zig b/official/release-3.4.0/api/surface.zig index 08cebf0..02e7681 100644 --- a/official/release-3.4.0/api/surface.zig +++ b/official/release-3.4.0/api/surface.zig @@ -1,86 +1,19 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG -}; - -pub const BlendMode = u32; - -pub const IOStream = opaque { - pub inline fn loadSurface_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadSurface_IO(iostream, closeio); - } - - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadBMP_IO(iostream, closeio); - } - - pub inline fn loadPNG_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return c.SDL_LoadPNG_IO(iostream, closeio); - } -}; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const Palette = extern struct { - ncolors: c_int, // number of elements in `colors`. - colors: ?*Color, // an array of colors, `ncolors` long. - version: u32, // internal use only, do not touch. - refcount: c_int, // internal use only, do not touch. -}; - -pub const Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, -}; - -pub const Colorspace = enum(c_int) { - colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - colorRangeFull, - colorPrimariesBt709, - transferCharacteristicsSrgb, - matrixCoefficientsIdentity, - colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - transferCharacteristicsLinear, - colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 - colorPrimariesBt2020, - transferCharacteristicsPq, - colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 - transferCharacteristicsBt601, - matrixCoefficientsBt601, - colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorRangeLimited, - colorPrimariesBt601, - colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 - colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - transferCharacteristicsBt709, - matrixCoefficientsBt709, - colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 - colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 - matrixCoefficientsBt2020Ncl, - colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 - colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified - colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified -}; - -pub const PropertiesID = u32; +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; pub const SurfaceFlags = packed struct(u32) { surfacePreallocated: bool = false, // Surface uses preallocated pixel memory @@ -89,267 +22,284 @@ pub const SurfaceFlags = packed struct(u32) { surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() pad0: u27 = 0, rsvd: bool = false, + + pub const None = SurfaceFlags{}; }; pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering - scalemodePixelart, + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 }; -pub const FlipMode = enum(c_int) { - flipNone, //Do not flip - flipHorizontal, //flip horizontally - flipVertical, //flip vertically - flipHorizontalAndVertical, //flip horizontally and vertically (not a diagonal flip) +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; }; pub const Surface = opaque { pub inline fn destroySurface(surface: *Surface) void { - return c.SDL_DestroySurface(surface); + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); } pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { - return c.SDL_GetSurfaceProperties(surface); + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); } pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { - return c.SDL_SetSurfaceColorspace(surface, colorspace); + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); } pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { - return c.SDL_GetSurfaceColorspace(surface); + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); } pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { - return c.SDL_CreateSurfacePalette(surface); + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { - return c.SDL_SetSurfacePalette(surface, palette); + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); } pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { - return c.SDL_GetSurfacePalette(surface); + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); } pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { - return c.SDL_AddSurfaceAlternateImage(surface, image); + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); } pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { - return c.SDL_SurfaceHasAlternateImages(surface); + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c][*c]Surface { - return c.SDL_GetSurfaceImages(surface, @ptrCast(count)); + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); } pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { - return c.SDL_RemoveSurfaceAlternateImages(surface); + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); } pub inline fn lockSurface(surface: *Surface) bool { - return c.SDL_LockSurface(surface); + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); } pub inline fn unlockSurface(surface: *Surface) void { - return c.SDL_UnlockSurface(surface); + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); } pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return c.SDL_SaveBMP_IO(surface, dst, closeio); + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { - return c.SDL_SaveBMP(surface, file); + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); } pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return c.SDL_SavePNG_IO(surface, dst, closeio); + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); } pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { - return c.SDL_SavePNG(surface, file); + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); } pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { - return c.SDL_SetSurfaceRLE(surface, enabled); + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); } pub inline fn surfaceHasRLE(surface: *Surface) bool { - return c.SDL_SurfaceHasRLE(surface); + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); } pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { - return c.SDL_SetSurfaceColorKey(surface, enabled, key); + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); } pub inline fn surfaceHasColorKey(surface: *Surface) bool { - return c.SDL_SurfaceHasColorKey(surface); + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); } - pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool { - return c.SDL_GetSurfaceColorKey(surface, @ptrCast(key)); + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); } pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { - return c.SDL_SetSurfaceColorMod(surface, r, g, b); + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { - return c.SDL_GetSurfaceColorMod(surface, r, g, b); + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); } pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { - return c.SDL_SetSurfaceAlphaMod(surface, alpha); + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { - return c.SDL_GetSurfaceAlphaMod(surface, alpha); + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); } pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { - return c.SDL_SetSurfaceBlendMode(surface, @intFromEnum(blendMode)); + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { - return c.SDL_GetSurfaceBlendMode(surface, @intFromEnum(blendMode)); + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); } - pub inline fn setSurfaceClipRect(surface: *Surface, rect: *const Rect) bool { - return c.SDL_SetSurfaceClipRect(surface, @ptrCast(rect)); + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { - return c.SDL_GetSurfaceClipRect(surface, rect); + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); } pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { - return c.SDL_FlipSurface(surface, @intFromEnum(flip)); + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); } pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { - return c.SDL_RotateSurface(surface, angle); + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); } pub inline fn duplicateSurface(surface: *Surface) ?*Surface { - return c.SDL_DuplicateSurface(surface); + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); } pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { - return c.SDL_ScaleSurface(surface, width, height, @intFromEnum(scaleMode)); + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); } pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { - return c.SDL_ConvertSurface(surface, @bitCast(format)); + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); } pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { - return c.SDL_ConvertSurfaceAndColorspace(surface, @bitCast(format), palette, colorspace, props); + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); } pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { - return c.SDL_PremultiplySurfaceAlpha(surface, linear); + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); } pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_ClearSurface(surface, r, g, b, a); + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); } - pub inline fn fillSurfaceRect(surface: *Surface, rect: *const Rect, color: u32) bool { - return c.SDL_FillSurfaceRect(surface, @ptrCast(rect), color); + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); } - pub inline fn fillSurfaceRects(surface: *Surface, rects: *const Rect, count: c_int, color: u32) bool { - return c.SDL_FillSurfaceRects(surface, @ptrCast(rects), count, color); + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); } - pub inline fn blitSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } - pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceUnchecked(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } - pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_BlitSurfaceScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } - pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_BlitSurfaceUncheckedScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } - pub inline fn stretchSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool { - return c.SDL_StretchSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode)); + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); } - pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceTiled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect)); + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } - pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: *const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurfaceTiledWithScale(surface, @ptrCast(srcrect), scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect)); + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } - pub inline fn blitSurface9Grid(surface: *Surface, srcrect: *const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool { - return c.SDL_BlitSurface9Grid(surface, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect)); + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); } pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { - return c.SDL_MapSurfaceRGB(surface, r, g, b); + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); } pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { - return c.SDL_MapSurfaceRGBA(surface, r, g, b, a); + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); } pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { - return c.SDL_ReadSurfacePixel(surface, x, y, r, g, b, a); + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } - pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool { - return c.SDL_ReadSurfacePixelFloat(surface, x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a)); + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { - return c.SDL_WriteSurfacePixel(surface, x, y, r, g, b, a); + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { - return c.SDL_WriteSurfacePixelFloat(surface, x, y, r, g, b, a); + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); } }; pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { - return c.SDL_CreateSurface(width, height, @bitCast(format)); + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); } pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { - return c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch); + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadSurface(file: [*c]const u8) ?*Surface { - return c.SDL_LoadSurface(file); + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadBMP(file: [*c]const u8) ?*Surface { - return c.SDL_LoadBMP(file); + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); } pub inline fn loadPNG(file: [*c]const u8) ?*Surface { - return c.SDL_LoadPNG(file); + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); } pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { - return c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch); + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); } pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { - return c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch); + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); } pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { - return c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, linear); + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); } diff --git a/official/release-3.4.0/api/system.zig b/official/release-3.4.0/api/system.zig index 8863cba..2972144 100644 --- a/official/release-3.4.0/api/system.zig +++ b/official/release-3.4.0/api/system.zig @@ -1,13 +1,9 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); -pub const DisplayID = u32; - -pub const Window = opaque { - pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { - return c.SDL_SetiOSAnimationCallback(window, interval, callback, callbackParam); - } -}; +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; pub const MSG = opaque {}; @@ -21,8 +17,8 @@ pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { return c.SDL_GetDirect3D9AdapterIndex(displayID); } -pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool { - return c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex)); +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); } pub const X11EventHook = c.SDL_X11EventHook; @@ -32,17 +28,21 @@ pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) voi } pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { - return c.SDL_SetLinuxThreadPriority(threadID, priority); + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); } pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { - return c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy); + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); } pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + pub inline fn setiOSEventPump(enabled: bool) void { - return c.SDL_SetiOSEventPump(enabled); + return c.SDL_SetiOSEventPump(@bitCast(enabled)); } pub inline fn getAndroidJNIEnv() ?*anyopaque { @@ -58,11 +58,11 @@ pub inline fn getAndroidSDKVersion() c_int { } pub inline fn isChromebook() bool { - return c.SDL_IsChromebook(); + return @bitCast(c.SDL_IsChromebook()); } pub inline fn isDeXMode() bool { - return c.SDL_IsDeXMode(); + return @bitCast(c.SDL_IsDeXMode()); } pub inline fn sendAndroidBackButton() void { @@ -88,26 +88,27 @@ pub inline fn getAndroidCachePath() [*c]const u8 { pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { - return c.SDL_RequestAndroidPermission(permission, cb, userdata); + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); } pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { - return c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset); + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); } pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { - return c.SDL_SendAndroidMessage(command, param); + return @bitCast(c.SDL_SendAndroidMessage(command, param)); } pub inline fn isTablet() bool { - return c.SDL_IsTablet(); + return @bitCast(c.SDL_IsTablet()); } pub inline fn isTV() bool { - return c.SDL_IsTV(); + return @bitCast(c.SDL_IsTV()); } pub const Sandbox = enum(c_int) { + sandboxNone = 0, sandboxUnknownContainer, sandboxFlatpak, sandboxSnap, @@ -115,7 +116,7 @@ pub const Sandbox = enum(c_int) { }; pub inline fn getSandbox() Sandbox { - return c.SDL_GetSandbox(); + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); } pub inline fn onApplicationWillTerminate() void { @@ -146,14 +147,14 @@ pub inline fn onApplicationDidChangeStatusBarOrientation() void { return c.SDL_OnApplicationDidChangeStatusBarOrientation(); } -pub const XTaskQueueHandle = *anyopaque; +pub const XTaskQueueHandle = ?*anyopaque; -pub const XUserHandle = *anyopaque; +pub const XUserHandle = ?*anyopaque; pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { - return c.SDL_GetGDKTaskQueue(outTaskQueue); + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); } pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { - return c.SDL_GetGDKDefaultUser(outUserHandle); + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); } diff --git a/official/release-3.4.0/api/time.zig b/official/release-3.4.0/api/time.zig index 5b93219..4eff0c3 100644 --- a/official/release-3.4.0/api/time.zig +++ b/official/release-3.4.0/api/time.zig @@ -1,7 +1,8 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); -pub const Time = i64; +pub const Time = stdinc_api.Time; pub const DateTime = extern struct { year: c_int, // Year @@ -16,34 +17,34 @@ pub const DateTime = extern struct { }; pub const DateFormat = enum(c_int) { - dateFormatYyyymmdd, //Year/Month/Day - dateFormatDdmmyyyy, //Day/Month/Year - dateFormatMmddyyyy, //Month/Day/Year + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year }; pub const TimeFormat = enum(c_int) { - timeFormat24hr, //24 hour time - timeFormat12hr, //12 hour time + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time }; pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { - return c.SDL_GetDateTimeLocalePreferences(@bitCast(dateFormat), @bitCast(timeFormat)); + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); } pub inline fn getCurrentTime(ticks: ?*Time) bool { - return c.SDL_GetCurrentTime(ticks); + return @bitCast(c.SDL_GetCurrentTime(ticks)); } pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { - return c.SDL_TimeToDateTime(ticks, dt, localTime); + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); } -pub inline fn dateTimeToTime(dt: *const DateTime, ticks: ?*Time) bool { - return c.SDL_DateTimeToTime(@ptrCast(dt), ticks); +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); } -pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void { - return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime)); +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); } pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { diff --git a/official/release-3.4.0/api/timer.zig b/official/release-3.4.0/api/timer.zig index 3300d85..72b8518 100644 --- a/official/release-3.4.0/api/timer.zig +++ b/official/release-3.4.0/api/timer.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getTicks() u64 { return c.SDL_GetTicks(); } @@ -44,5 +43,5 @@ pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*a } pub inline fn removeTimer(id: TimerID) bool { - return c.SDL_RemoveTimer(id); + return @bitCast(c.SDL_RemoveTimer(id)); } diff --git a/official/release-3.4.0/api/touch.zig b/official/release-3.4.0/api/touch.zig index 2394cdc..7c54650 100644 --- a/official/release-3.4.0/api/touch.zig +++ b/official/release-3.4.0/api/touch.zig @@ -1,11 +1,11 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub const TouchID = u64; pub const FingerID = u64; pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, touchDeviceDirect, //touch screen with window-relative coordinates touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates @@ -18,8 +18,8 @@ pub const Finger = extern struct { pressure: f32, // the quantity of pressure applied, normalized (0...1) }; -pub inline fn getTouchDevices(count: *c_int) ?*TouchID { - return c.SDL_GetTouchDevices(@ptrCast(count)); +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); } pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { @@ -27,9 +27,9 @@ pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { } pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { - return @intFromEnum(c.SDL_GetTouchDeviceType(touchID)); + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); } -pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c][*c]Finger { - return c.SDL_GetTouchFingers(touchID, @ptrCast(count)); +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); } diff --git a/official/release-3.4.0/api/tray.zig b/official/release-3.4.0/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.0/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.0/api/version.zig b/official/release-3.4.0/api/version.zig index 8cef3e8..0c0b4f9 100644 --- a/official/release-3.4.0/api/version.zig +++ b/official/release-3.4.0/api/version.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub const c = @import("c.zig").c; - pub inline fn getVersion() c_int { return c.SDL_GetVersion(); } diff --git a/official/release-3.4.0/api/video.zig b/official/release-3.4.0/api/video.zig index 1cb6643..408b91a 100644 --- a/official/release-3.4.0/api/video.zig +++ b/official/release-3.4.0/api/video.zig @@ -1,36 +1,17 @@ const std = @import("std"); pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); -pub const PixelFormat = enum(c_int) { - pixelformatYv12, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes, //Android video texture format - pixelformatMjpg, //Motion JPEG -}; - -pub const Point = extern struct { - x: c_int, - y: c_int, -}; - -pub const Surface = opaque {}; - -pub const PropertiesID = u32; - -pub const Rect = extern struct { - x: c_int, - y: c_int, - w: c_int, - h: c_int, -}; - -pub const FunctionPointer = c.SDL_FunctionPointer; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; pub const DisplayID = u32; @@ -61,292 +42,292 @@ pub const DisplayOrientation = enum(c_int) { orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode orientationPortrait, //The display is in portrait mode - orientationPortraitFlipped, + orientationPortraitFlipped, //The display is in portrait mode, upside down }; pub const Window = opaque { pub inline fn getDisplayForWindow(window: *Window) DisplayID { - return c.SDL_GetDisplayForWindow(window); + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); } pub inline fn getWindowPixelDensity(window: *Window) f32 { - return c.SDL_GetWindowPixelDensity(window); + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); } pub inline fn getWindowDisplayScale(window: *Window) f32 { - return c.SDL_GetWindowDisplayScale(window); + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); } - pub inline fn setWindowFullscreenMode(window: *Window, mode: *const DisplayMode) bool { - return c.SDL_SetWindowFullscreenMode(window, @ptrCast(mode)); + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); } - pub inline fn getWindowFullscreenMode(window: *Window) *const DisplayMode { - return @ptrCast(c.SDL_GetWindowFullscreenMode(window)); + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); } - pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque { - return c.SDL_GetWindowICCProfile(window, @ptrCast(size)); + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); } pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { - return @bitCast(c.SDL_GetWindowPixelFormat(window)); + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); } pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return c.SDL_CreatePopupWindow(window, offset_x, offset_y, w, h, @bitCast(flags)); + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); } pub inline fn getWindowID(window: *Window) WindowID { - return c.SDL_GetWindowID(window); + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); } pub inline fn getWindowParent(window: *Window) ?*Window { - return c.SDL_GetWindowParent(window); + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); } pub inline fn getWindowProperties(window: *Window) PropertiesID { - return c.SDL_GetWindowProperties(window); + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); } pub inline fn getWindowFlags(window: *Window) WindowFlags { - return @bitCast(c.SDL_GetWindowFlags(window)); + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); } pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { - return c.SDL_SetWindowTitle(window, title); + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); } pub inline fn getWindowTitle(window: *Window) [*c]const u8 { - return c.SDL_GetWindowTitle(window); + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); } pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { - return c.SDL_SetWindowIcon(window, icon); + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); } pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { - return c.SDL_SetWindowPosition(window, x, y); + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } - pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool { - return c.SDL_GetWindowPosition(window, @ptrCast(x), @ptrCast(y)); + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { - return c.SDL_SetWindowSize(window, w, h); + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); } - pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool { - return c.SDL_GetWindowSize(window, @ptrCast(w), @ptrCast(h)); + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { - return c.SDL_GetWindowSafeArea(window, rect); + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { - return c.SDL_SetWindowAspectRatio(window, min_aspect, max_aspect); + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool { - return c.SDL_GetWindowAspectRatio(window, @ptrCast(min_aspect), @ptrCast(max_aspect)); + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); } - pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool { - return c.SDL_GetWindowBordersSize(window, @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right)); + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); } - pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool { - return c.SDL_GetWindowSizeInPixels(window, @ptrCast(w), @ptrCast(h)); + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { - return c.SDL_SetWindowMinimumSize(window, min_w, min_h); + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); } - pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool { - return c.SDL_GetWindowMinimumSize(window, @ptrCast(w), @ptrCast(h)); + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { - return c.SDL_SetWindowMaximumSize(window, max_w, max_h); + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); } - pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool { - return c.SDL_GetWindowMaximumSize(window, @ptrCast(w), @ptrCast(h)); + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); } pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { - return c.SDL_SetWindowBordered(window, bordered); + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); } pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { - return c.SDL_SetWindowResizable(window, resizable); + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); } pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { - return c.SDL_SetWindowAlwaysOnTop(window, on_top); + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); } pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { - return c.SDL_SetWindowFillDocument(window, fill); + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); } pub inline fn showWindow(window: *Window) bool { - return c.SDL_ShowWindow(window); + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); } pub inline fn hideWindow(window: *Window) bool { - return c.SDL_HideWindow(window); + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); } pub inline fn raiseWindow(window: *Window) bool { - return c.SDL_RaiseWindow(window); + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); } pub inline fn maximizeWindow(window: *Window) bool { - return c.SDL_MaximizeWindow(window); + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn minimizeWindow(window: *Window) bool { - return c.SDL_MinimizeWindow(window); + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); } pub inline fn restoreWindow(window: *Window) bool { - return c.SDL_RestoreWindow(window); + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); } pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { - return c.SDL_SetWindowFullscreen(window, fullscreen); + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); } pub inline fn syncWindow(window: *Window) bool { - return c.SDL_SyncWindow(window); + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); } pub inline fn windowHasSurface(window: *Window) bool { - return c.SDL_WindowHasSurface(window); + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); } pub inline fn getWindowSurface(window: *Window) ?*Surface { - return c.SDL_GetWindowSurface(window); + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); } pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { - return c.SDL_SetWindowSurfaceVSync(window, vsync); + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } - pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool { - return c.SDL_GetWindowSurfaceVSync(window, @ptrCast(vsync)); + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); } pub inline fn updateWindowSurface(window: *Window) bool { - return c.SDL_UpdateWindowSurface(window); + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); } - pub inline fn updateWindowSurfaceRects(window: *Window, rects: *const Rect, numrects: c_int) bool { - return c.SDL_UpdateWindowSurfaceRects(window, @ptrCast(rects), numrects); + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); } pub inline fn destroyWindowSurface(window: *Window) bool { - return c.SDL_DestroyWindowSurface(window); + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); } pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { - return c.SDL_SetWindowKeyboardGrab(window, grabbed); + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { - return c.SDL_SetWindowMouseGrab(window, grabbed); + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); } pub inline fn getWindowKeyboardGrab(window: *Window) bool { - return c.SDL_GetWindowKeyboardGrab(window); + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); } pub inline fn getWindowMouseGrab(window: *Window) bool { - return c.SDL_GetWindowMouseGrab(window); + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); } - pub inline fn setWindowMouseRect(window: *Window, rect: *const Rect) bool { - return c.SDL_SetWindowMouseRect(window, @ptrCast(rect)); + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); } - pub inline fn getWindowMouseRect(window: *Window) *const Rect { - return @ptrCast(c.SDL_GetWindowMouseRect(window)); + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); } pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { - return c.SDL_SetWindowOpacity(window, opacity); + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); } pub inline fn getWindowOpacity(window: *Window) f32 { - return c.SDL_GetWindowOpacity(window); + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); } pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { - return c.SDL_SetWindowParent(window, parent); + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); } pub inline fn setWindowModal(window: *Window, modal: bool) bool { - return c.SDL_SetWindowModal(window, modal); + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); } pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { - return c.SDL_SetWindowFocusable(window, focusable); + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); } pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { - return c.SDL_ShowWindowSystemMenu(window, x, y); + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); } pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { - return c.SDL_SetWindowHitTest(window, callback, callback_data); + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); } pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { - return c.SDL_SetWindowShape(window, shape); + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); } pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { - return c.SDL_FlashWindow(window, @intFromEnum(operation)); + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); } pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { - return c.SDL_SetWindowProgressState(window, state); + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); } pub inline fn getWindowProgressState(window: *Window) ProgressState { - return c.SDL_GetWindowProgressState(window); + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); } pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { - return c.SDL_SetWindowProgressValue(window, value); + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); } pub inline fn getWindowProgressValue(window: *Window) f32 { - return c.SDL_GetWindowProgressValue(window); + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); } pub inline fn destroyWindow(window: *Window) void { - return c.SDL_DestroyWindow(window); + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); } pub inline fn gl_CreateContext(window: *Window) GLContext { - return c.SDL_GL_CreateContext(window); + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); } pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { - return c.SDL_GL_MakeCurrent(window, context); + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); } pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { - return c.SDL_EGL_GetWindowSurface(window); + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); } pub inline fn gl_SwapWindow(window: *Window) bool { - return c.SDL_GL_SwapWindow(window); + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); } }; @@ -373,12 +354,15 @@ pub const WindowFlags = packed struct(u64) { windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, windowVulkan: bool = false, // window usable for Vulkan surface windowMetal: bool = false, // window usable for Metal view windowTransparent: bool = false, // window with transparent buffer windowNotFocusable: bool = false, // window should not be focusable - pad0: u37 = 0, + pad1: u31 = 0, rsvd: bool = false, + + pub const None = WindowFlags{}; }; pub const FlashOperation = enum(c_int) { @@ -388,7 +372,7 @@ pub const FlashOperation = enum(c_int) { }; pub const ProgressState = enum(c_int) { - progressStateInvalid, //An invalid progress state indicating an error; check SDL_GetError() + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() progressStateNone, //No progress bar is shown progressStateIndeterminate, //The progress bar is shown in a indeterminate state progressStateNormal, //The progress bar is shown in a normal state @@ -396,7 +380,7 @@ pub const ProgressState = enum(c_int) { progressStateError, //The progress bar is shown in a state indicating the application had an error }; -pub const GLContext = *anyopaque; +pub const GLContext = ?*anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -464,11 +448,11 @@ pub inline fn getCurrentVideoDriver() [*c]const u8 { } pub inline fn getSystemTheme() SystemTheme { - return c.SDL_GetSystemTheme(); + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); } -pub inline fn getDisplays(count: *c_int) ?*DisplayID { - return c.SDL_GetDisplays(@ptrCast(count)); +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); } pub inline fn getPrimaryDisplay() DisplayID { @@ -484,67 +468,67 @@ pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { } pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { - return c.SDL_GetDisplayBounds(displayID, rect); + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { - return c.SDL_GetDisplayUsableBounds(displayID, rect); + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); } pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetNaturalDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); } pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { - return c.SDL_GetCurrentDisplayOrientation(displayID); + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); } pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { return c.SDL_GetDisplayContentScale(displayID); } -pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c][*c]DisplayMode { - return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count))); +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); } pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { - return c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, include_high_density_modes, @intFromEnum(closest)); + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); } -pub inline fn getDesktopDisplayMode(displayID: DisplayID) *const DisplayMode { - return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID)); +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); } -pub inline fn getCurrentDisplayMode(displayID: DisplayID) *const DisplayMode { - return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID)); +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); } -pub inline fn getDisplayForPoint(point: *const Point) DisplayID { - return c.SDL_GetDisplayForPoint(@ptrCast(point)); +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); } -pub inline fn getDisplayForRect(rect: *const Rect) DisplayID { - return c.SDL_GetDisplayForRect(@ptrCast(rect)); +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); } -pub inline fn getWindows(count: *c_int) [*c][*c]Window { - return c.SDL_GetWindows(@ptrCast(count)); +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); } pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { - return c.SDL_CreateWindow(title, w, h, @bitCast(flags)); + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); } pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { - return c.SDL_CreateWindowWithProperties(props); + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); } pub inline fn getWindowFromID(id: WindowID) ?*Window { - return c.SDL_GetWindowFromID(id); + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); } pub inline fn getGrabbedWindow() ?*Window { - return c.SDL_GetGrabbedWindow(); + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); } pub const HitTestResult = enum(c_int) { @@ -563,19 +547,19 @@ pub const HitTestResult = enum(c_int) { pub const HitTest = c.SDL_HitTest; pub inline fn screenSaverEnabled() bool { - return c.SDL_ScreenSaverEnabled(); + return @bitCast(c.SDL_ScreenSaverEnabled()); } pub inline fn enableScreenSaver() bool { - return c.SDL_EnableScreenSaver(); + return @bitCast(c.SDL_EnableScreenSaver()); } pub inline fn disableScreenSaver() bool { - return c.SDL_DisableScreenSaver(); + return @bitCast(c.SDL_DisableScreenSaver()); } pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { - return c.SDL_GL_LoadLibrary(path); + return @bitCast(c.SDL_GL_LoadLibrary(path)); } pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { @@ -591,7 +575,7 @@ pub inline fn gl_UnloadLibrary() void { } pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { - return c.SDL_GL_ExtensionSupported(extension); + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); } pub inline fn gl_ResetAttributes() void { @@ -599,19 +583,19 @@ pub inline fn gl_ResetAttributes() void { } pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { - return c.SDL_GL_SetAttribute(attr, value); + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); } -pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool { - return c.SDL_GL_GetAttribute(attr, @ptrCast(value)); +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); } pub inline fn gl_GetCurrentWindow() ?*Window { - return c.SDL_GL_GetCurrentWindow(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); } pub inline fn gl_GetCurrentContext() GLContext { - return c.SDL_GL_GetCurrentContext(); + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); } pub inline fn egl_GetCurrentDisplay() EGLDisplay { @@ -627,13 +611,13 @@ pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCa } pub inline fn gl_SetSwapInterval(interval: c_int) bool { - return c.SDL_GL_SetSwapInterval(interval); + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); } -pub inline fn gl_GetSwapInterval(interval: *c_int) bool { - return c.SDL_GL_GetSwapInterval(@ptrCast(interval)); +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); } pub inline fn gl_DestroyContext(context: GLContext) bool { - return c.SDL_GL_DestroyContext(context); + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); } diff --git a/official/release-3.4.0/json/audio.json b/official/release-3.4.0/json/audio.json index 8789458..49dec69 100644 --- a/official/release-3.4.0/json/audio.json +++ b/official/release-3.4.0/json/audio.json @@ -71,6 +71,18 @@ "name": "SDL_AUDIO_F32BE", "value": "0x9120u", "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" } ] } diff --git a/official/release-3.4.0/json/blendmode.json b/official/release-3.4.0/json/blendmode.json index 2da4acb..d80e56a 100644 --- a/official/release-3.4.0/json/blendmode.json +++ b/official/release-3.4.0/json/blendmode.json @@ -35,7 +35,8 @@ }, { "name": "SDL_BLENDOPERATION_MAXIMUM", - "value": "0x5" + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" } ] }, @@ -89,7 +90,8 @@ }, { "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", - "value": "0xA" + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" } ] } diff --git a/official/release-3.4.0/json/camera.json b/official/release-3.4.0/json/camera.json index 14b234f..1405b5e 100644 --- a/official/release-3.4.0/json/camera.json +++ b/official/release-3.4.0/json/camera.json @@ -31,6 +31,10 @@ { "name": "SDL_CameraPermissionState", "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, { "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" }, diff --git a/official/release-3.4.0/json/events.json b/official/release-3.4.0/json/events.json index a2aad31..f7c6aa7 100644 --- a/official/release-3.4.0/json/events.json +++ b/official/release-3.4.0/json/events.json @@ -23,22 +23,28 @@ "comment": "User-requested quit" }, { - "name": "SDL_EVENT_TERMINATING" + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" }, { - "name": "SDL_EVENT_LOW_MEMORY" + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" }, { - "name": "SDL_EVENT_WILL_ENTER_BACKGROUND" + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" }, { - "name": "SDL_EVENT_DID_ENTER_BACKGROUND" + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" }, { - "name": "SDL_EVENT_WILL_ENTER_FOREGROUND" + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" }, { - "name": "SDL_EVENT_DID_ENTER_FOREGROUND" + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" }, { "name": "SDL_EVENT_LOCALE_CHANGED", @@ -81,6 +87,14 @@ "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", "comment": "Display has changed usable bounds" }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -91,7 +105,8 @@ "comment": "Window has been hidden" }, { - "name": "SDL_EVENT_WINDOW_EXPOSED" + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." }, { "name": "SDL_EVENT_WINDOW_MOVED", @@ -174,12 +189,21 @@ "comment": "The window has left fullscreen mode" }, { - "name": "SDL_EVENT_WINDOW_DESTROYED" + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" }, { "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", "comment": "Window HDR properties have changed" }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, { "name": "SDL_EVENT_KEY_DOWN", "value": "0x300", @@ -198,7 +222,8 @@ "comment": "Keyboard text input" }, { - "name": "SDL_EVENT_KEYMAP_CHANGED" + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." }, { "name": "SDL_EVENT_KEYBOARD_ADDED", @@ -331,6 +356,10 @@ "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", "comment": "Gamepad Steam handle has changed" }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, { "name": "SDL_EVENT_FINGER_UP" }, @@ -460,6 +489,10 @@ "name": "SDL_EVENT_RENDER_DEVICE_LOST", "comment": "The device has been lost and can't be recovered." }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, { "name": "SDL_EVENT_PRIVATE1" }, @@ -473,6 +506,18 @@ "name": "SDL_EVENT_POLL_SENTINEL", "value": "0x7F00", "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" } ] }, @@ -1117,6 +1162,10 @@ "type": "Uint8", "comment": "The joystick hat index" }, + { + "name": "value", + "type": "Uint8" + }, { "name": "padding1", "type": "Uint8" diff --git a/official/release-3.4.0/json/filesystem.json b/official/release-3.4.0/json/filesystem.json index 25d3c30..37e102f 100644 --- a/official/release-3.4.0/json/filesystem.json +++ b/official/release-3.4.0/json/filesystem.json @@ -57,7 +57,8 @@ "comment": "Video files that can be played using a standard video player (mp4, webm...)." }, { - "name": "SDL_FOLDER_COUNT" + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." } ] }, @@ -77,7 +78,8 @@ "comment": "a directory" }, { - "name": "SDL_PATHTYPE_OTHER" + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" } ] }, @@ -93,7 +95,8 @@ "comment": "Value that requests that enumeration stop, successfully." }, { - "name": "SDL_ENUM_FAILURE" + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." } ] } diff --git a/official/release-3.4.0/json/gamepad.json b/official/release-3.4.0/json/gamepad.json index a3acc3a..7ffbe51 100644 --- a/official/release-3.4.0/json/gamepad.json +++ b/official/release-3.4.0/json/gamepad.json @@ -12,6 +12,10 @@ { "name": "SDL_GamepadType", "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, { "name": "SDL_GAMEPAD_TYPE_STANDARD" }, @@ -53,6 +57,10 @@ { "name": "SDL_GamepadButton", "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_BUTTON_SOUTH", "comment": "Bottom face button (e.g. Xbox A button)" @@ -186,6 +194,10 @@ { "name": "SDL_GamepadAxis", "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, { "name": "SDL_GAMEPAD_AXIS_LEFTX" }, @@ -212,6 +224,10 @@ { "name": "SDL_GamepadBindingType", "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, { "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" }, diff --git a/official/release-3.4.0/json/gpu.json b/official/release-3.4.0/json/gpu.json index 7368c6b..514880a 100644 --- a/official/release-3.4.0/json/gpu.json +++ b/official/release-3.4.0/json/gpu.json @@ -41,12 +41,7 @@ "name": "SDL_GPUFence" } ], - "typedefs": [ - { - "name": "SDL_GPUShaderFormat", - "underlying_type": "Uint32" - } - ], + "typedefs": [], "function_pointers": [], "c_type_aliases": [], "enums": [ @@ -794,7 +789,8 @@ "comment": "min(source, destination)" }, { - "name": "SDL_GPU_BLENDOP_MAX" + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" } ] }, @@ -853,7 +849,8 @@ "comment": "1 - blend constant" }, { - "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE" + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" } ] }, @@ -2338,6 +2335,42 @@ } ] }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, { "name": "SDL_GPUColorComponentFlags", "underlying_type": "Uint8", diff --git a/official/release-3.4.0/json/guid.json b/official/release-3.4.0/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.0/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/haptic.json b/official/release-3.4.0/json/haptic.json index 55640bf..83227a3 100644 --- a/official/release-3.4.0/json/haptic.json +++ b/official/release-3.4.0/json/haptic.json @@ -105,6 +105,10 @@ { "name": "SDL_HapticPeriodic", "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, { "name": "direction", "type": "SDL_HapticDirection", @@ -175,6 +179,10 @@ { "name": "SDL_HapticCondition", "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, { "name": "direction", "type": "SDL_HapticDirection", diff --git a/official/release-3.4.0/json/init.json b/official/release-3.4.0/json/init.json index 83fecb9..d315e0e 100644 --- a/official/release-3.4.0/json/init.json +++ b/official/release-3.4.0/json/init.json @@ -48,40 +48,40 @@ "values": [ { "name": "SDL_INIT_AUDIO", - "value": "0x00000010u", + "value": "(1u << 4)", "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_VIDEO", - "value": "0x00000020u", + "value": "(1u << 5)", "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" }, { "name": "SDL_INIT_JOYSTICK", - "value": "0x00000200u", + "value": "(1u << 9)", "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_HAPTIC", - "value": "0x00001000u" + "value": "(1u << 12)" }, { "name": "SDL_INIT_GAMEPAD", - "value": "0x00002000u", + "value": "(1u << 13)", "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" }, { "name": "SDL_INIT_EVENTS", - "value": "0x00004000u" + "value": "(1u << 14)" }, { "name": "SDL_INIT_SENSOR", - "value": "0x00008000u", + "value": "(1u << 15)", "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" }, { "name": "SDL_INIT_CAMERA", - "value": "0x00010000u", + "value": "(1u << 16)", "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" } ] diff --git a/official/release-3.4.0/json/iostream.json b/official/release-3.4.0/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.0/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/joystick.json b/official/release-3.4.0/json/joystick.json index 4987f44..a9aa729 100644 --- a/official/release-3.4.0/json/joystick.json +++ b/official/release-3.4.0/json/joystick.json @@ -55,6 +55,10 @@ { "name": "SDL_JoystickConnectionState", "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, { "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" }, @@ -160,6 +164,14 @@ "type": "Uint16[2]", "comment": "unused" }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, { "name": "name", "type": "const char *", diff --git a/official/release-3.4.0/json/keyboard.json b/official/release-3.4.0/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.0/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/messagebox.json b/official/release-3.4.0/json/messagebox.json index 3d417d3..d9ab053 100644 --- a/official/release-3.4.0/json/messagebox.json +++ b/official/release-3.4.0/json/messagebox.json @@ -122,27 +122,27 @@ "values": [ { "name": "SDL_MESSAGEBOX_ERROR", - "value": "0x00000010u", + "value": "(1u << 4)", "comment": "error dialog" }, { "name": "SDL_MESSAGEBOX_WARNING", - "value": "0x00000020u", + "value": "(1u << 5)", "comment": "warning dialog" }, { "name": "SDL_MESSAGEBOX_INFORMATION", - "value": "0x00000040u", + "value": "(1u << 6)", "comment": "informational dialog" }, { "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", - "value": "0x00000080u", + "value": "(1u << 7)", "comment": "buttons placed left to right" }, { "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", - "value": "0x00000100u", + "value": "(1u << 8)", "comment": "buttons placed right to left" } ] @@ -153,12 +153,12 @@ "values": [ { "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", - "value": "0x00000001u", + "value": "(1u << 0)", "comment": "Marks the default button when return is hit" }, { "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", - "value": "0x00000002u", + "value": "(1u << 1)", "comment": "Marks the default button when escape is hit" } ] diff --git a/official/release-3.4.0/json/mouse.json b/official/release-3.4.0/json/mouse.json index 72cd405..b8bbf8b 100644 --- a/official/release-3.4.0/json/mouse.json +++ b/official/release-3.4.0/json/mouse.json @@ -145,23 +145,15 @@ "values": [ { "name": "SDL_BUTTON_LEFT", - "value": "1" + "value": "(1u << 0)" }, { "name": "SDL_BUTTON_MIDDLE", - "value": "2" - }, - { - "name": "SDL_BUTTON_RIGHT", - "value": "3" + "value": "(1u << 1)" }, { "name": "SDL_BUTTON_X1", - "value": "4" - }, - { - "name": "SDL_BUTTON_X2", - "value": "5" + "value": "(1u << 2)" } ] } diff --git a/official/release-3.4.0/json/opengl.json b/official/release-3.4.0/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.0/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/pen.json b/official/release-3.4.0/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.0/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/pixels.json b/official/release-3.4.0/json/pixels.json index b7b9489..b5e344c 100644 --- a/official/release-3.4.0/json/pixels.json +++ b/official/release-3.4.0/json/pixels.json @@ -156,6 +156,226 @@ { "name": "SDL_PixelFormat", "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, { "name": "SDL_PIXELFORMAT_YV12", "value": "0x32315659u", @@ -205,16 +425,65 @@ "name": "SDL_PIXELFORMAT_MJPG", "value": "0x47504a4du", "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" } ] }, { "name": "SDL_ColorType", - "values": [] + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] }, { "name": "SDL_ColorRange", "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_RANGE_LIMITED", "value": "1", @@ -222,18 +491,27 @@ }, { "name": "SDL_COLOR_RANGE_FULL", - "value": "2" + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" } ] }, { "name": "SDL_ColorPrimaries", "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLOR_PRIMARIES_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_COLOR_PRIMARIES_BT470M", "value": "4", @@ -283,17 +561,29 @@ "name": "SDL_COLOR_PRIMARIES_EBU3213", "value": "22", "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" } ] }, { "name": "SDL_TransferCharacteristics", "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", "value": "1", "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", "value": "4", @@ -314,6 +604,18 @@ "value": "7", "comment": "SMPTE ST 240M" }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, { "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", "value": "11", @@ -353,17 +655,29 @@ "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", "value": "18", "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" } ] }, { "name": "SDL_MatrixCoefficients", "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT709", "value": "1", "comment": "ITU-R BT.709-6" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, { "name": "SDL_MATRIX_COEFFICIENTS_FCC", "value": "4", @@ -384,6 +698,10 @@ "value": "7", "comment": "SMPTE 240M" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, { "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", "value": "9", @@ -399,10 +717,22 @@ "value": "11", "comment": "SMPTE ST 2085" }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, { "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", "value": "14", "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" } ] }, @@ -426,71 +756,43 @@ }, { "name": "SDL_CHROMA_LOCATION_TOPLEFT", - "value": "3" + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." } ] }, { "name": "SDL_Colorspace", "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, { "name": "SDL_COLORSPACE_SRGB", "value": "0x120005a0u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" }, - { - "name": "SDL_COLOR_RANGE_FULL" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT709" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY" - }, { "name": "SDL_COLORSPACE_SRGB_LINEAR", "value": "0x12000500u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR" - }, { "name": "SDL_COLORSPACE_HDR10", "value": "0x12002600u", "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" }, - { - "name": "SDL_COLOR_PRIMARIES_BT2020" - }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_PQ" - }, { "name": "SDL_COLORSPACE_JPEG", "value": "0x220004c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT601" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT601" - }, { "name": "SDL_COLORSPACE_BT601_LIMITED", "value": "0x211018c6u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" }, - { - "name": "SDL_COLOR_RANGE_LIMITED" - }, - { - "name": "SDL_COLOR_PRIMARIES_BT601" - }, { "name": "SDL_COLORSPACE_BT601_FULL", "value": "0x221018c6u", @@ -501,12 +803,6 @@ "value": "0x21100421u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" }, - { - "name": "SDL_TRANSFER_CHARACTERISTICS_BT709" - }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT709" - }, { "name": "SDL_COLORSPACE_BT709_FULL", "value": "0x22100421u", @@ -517,9 +813,6 @@ "value": "0x21102609u", "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" }, - { - "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL" - }, { "name": "SDL_COLORSPACE_BT2020_FULL", "value": "0x22102609u", diff --git a/official/release-3.4.0/json/power.json b/official/release-3.4.0/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.0/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/process.json b/official/release-3.4.0/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.0/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/render.json b/official/release-3.4.0/json/render.json index bccb3fb..8c28849 100644 --- a/official/release-3.4.0/json/render.json +++ b/official/release-3.4.0/json/render.json @@ -35,6 +35,10 @@ { "name": "SDL_TextureAddressMode", "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, { "name": "SDL_TEXTURE_ADDRESS_AUTO", "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" diff --git a/official/release-3.4.0/json/scancode.json b/official/release-3.4.0/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.0/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/surface.json b/official/release-3.4.0/json/surface.json index 252efe7..af6fa27 100644 --- a/official/release-3.4.0/json/surface.json +++ b/official/release-3.4.0/json/surface.json @@ -12,6 +12,10 @@ { "name": "SDL_ScaleMode", "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, { "name": "SDL_SCALEMODE_NEAREST", "comment": "nearest pixel sampling" @@ -21,7 +25,8 @@ "comment": "linear filtering" }, { - "name": "SDL_SCALEMODE_PIXELART" + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" } ] }, @@ -57,22 +62,22 @@ "values": [ { "name": "SDL_SURFACE_PREALLOCATED", - "value": "0x00000001u", + "value": "(1u << 0)", "comment": "Surface uses preallocated pixel memory" }, { "name": "SDL_SURFACE_LOCK_NEEDED", - "value": "0x00000002u", + "value": "(1u << 1)", "comment": "Surface needs to be locked to access pixels" }, { "name": "SDL_SURFACE_LOCKED", - "value": "0x00000004u", + "value": "(1u << 2)", "comment": "Surface is currently locked" }, { "name": "SDL_SURFACE_SIMD_ALIGNED", - "value": "0x00000008u", + "value": "(1u << 3)", "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" } ] diff --git a/official/release-3.4.0/json/system.json b/official/release-3.4.0/json/system.json index a598bb0..4201c5a 100644 --- a/official/release-3.4.0/json/system.json +++ b/official/release-3.4.0/json/system.json @@ -34,6 +34,10 @@ { "name": "SDL_Sandbox", "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, { "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" }, diff --git a/official/release-3.4.0/json/touch.json b/official/release-3.4.0/json/touch.json index 90dc4bc..fc5caab 100644 --- a/official/release-3.4.0/json/touch.json +++ b/official/release-3.4.0/json/touch.json @@ -17,6 +17,10 @@ { "name": "SDL_TouchDeviceType", "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, { "name": "SDL_TOUCH_DEVICE_DIRECT", "comment": "touch screen with window-relative coordinates" diff --git a/official/release-3.4.0/json/tray.json b/official/release-3.4.0/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.0/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.0/json/video.json b/official/release-3.4.0/json/video.json index cef2a5b..cb4c11e 100644 --- a/official/release-3.4.0/json/video.json +++ b/official/release-3.4.0/json/video.json @@ -108,7 +108,8 @@ "comment": "The display is in portrait mode" }, { - "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED" + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" } ] }, @@ -379,132 +380,132 @@ "values": [ { "name": "SDL_WINDOW_FULLSCREEN", - "value": "SDL_UINT64_C(0x0000000000000001)", + "value": "(1u << 0)", "comment": "window is in fullscreen mode" }, { "name": "SDL_WINDOW_OPENGL", - "value": "SDL_UINT64_C(0x0000000000000002)", + "value": "(1u << 1)", "comment": "window usable with OpenGL context" }, { "name": "SDL_WINDOW_OCCLUDED", - "value": "SDL_UINT64_C(0x0000000000000004)", + "value": "(1u << 2)", "comment": "window is occluded" }, { "name": "SDL_WINDOW_HIDDEN", - "value": "SDL_UINT64_C(0x0000000000000008)", + "value": "(1u << 3)", "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" }, { "name": "SDL_WINDOW_BORDERLESS", - "value": "SDL_UINT64_C(0x0000000000000010)", + "value": "(1u << 4)", "comment": "no window decoration" }, { "name": "SDL_WINDOW_RESIZABLE", - "value": "SDL_UINT64_C(0x0000000000000020)", + "value": "(1u << 5)", "comment": "window can be resized" }, { "name": "SDL_WINDOW_MINIMIZED", - "value": "SDL_UINT64_C(0x0000000000000040)", + "value": "(1u << 6)", "comment": "window is minimized" }, { "name": "SDL_WINDOW_MAXIMIZED", - "value": "SDL_UINT64_C(0x0000000000000080)", + "value": "(1u << 7)", "comment": "window is maximized" }, { "name": "SDL_WINDOW_MOUSE_GRABBED", - "value": "SDL_UINT64_C(0x0000000000000100)", + "value": "(1u << 8)", "comment": "window has grabbed mouse input" }, { "name": "SDL_WINDOW_INPUT_FOCUS", - "value": "SDL_UINT64_C(0x0000000000000200)", + "value": "(1u << 9)", "comment": "window has input focus" }, { "name": "SDL_WINDOW_MOUSE_FOCUS", - "value": "SDL_UINT64_C(0x0000000000000400)", + "value": "(1u << 10)", "comment": "window has mouse focus" }, { "name": "SDL_WINDOW_EXTERNAL", - "value": "SDL_UINT64_C(0x0000000000000800)", + "value": "(1u << 11)", "comment": "window not created by SDL" }, { "name": "SDL_WINDOW_MODAL", - "value": "SDL_UINT64_C(0x0000000000001000)", + "value": "(1u << 12)", "comment": "window is modal" }, { "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", - "value": "SDL_UINT64_C(0x0000000000002000)", + "value": "(1u << 13)", "comment": "window uses high pixel density back buffer if possible" }, { "name": "SDL_WINDOW_MOUSE_CAPTURE", - "value": "SDL_UINT64_C(0x0000000000004000)", + "value": "(1u << 14)", "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" }, { "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", - "value": "SDL_UINT64_C(0x0000000000008000)", + "value": "(1u << 15)", "comment": "window has relative mode enabled" }, { "name": "SDL_WINDOW_ALWAYS_ON_TOP", - "value": "SDL_UINT64_C(0x0000000000010000)", + "value": "(1u << 16)", "comment": "window should always be above others" }, { "name": "SDL_WINDOW_UTILITY", - "value": "SDL_UINT64_C(0x0000000000020000)", + "value": "(1u << 17)", "comment": "window should be treated as a utility window, not showing in the task bar and window list" }, { "name": "SDL_WINDOW_TOOLTIP", - "value": "SDL_UINT64_C(0x0000000000040000)", + "value": "(1u << 18)", "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" }, { "name": "SDL_WINDOW_POPUP_MENU", - "value": "SDL_UINT64_C(0x0000000000080000)", + "value": "(1u << 19)", "comment": "window should be treated as a popup menu, requires a parent window" }, { "name": "SDL_WINDOW_KEYBOARD_GRABBED", - "value": "SDL_UINT64_C(0x0000000000100000)", + "value": "(1u << 20)", "comment": "window has grabbed keyboard input" }, { "name": "SDL_WINDOW_FILL_DOCUMENT", - "value": "SDL_UINT64_C(0x0000000000200000)", + "value": "(1u << 21)", "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" }, { "name": "SDL_WINDOW_VULKAN", - "value": "SDL_UINT64_C(0x0000000010000000)", + "value": "(1u << 28)", "comment": "window usable for Vulkan surface" }, { "name": "SDL_WINDOW_METAL", - "value": "SDL_UINT64_C(0x0000000020000000)", + "value": "(1u << 29)", "comment": "window usable for Metal view" }, { "name": "SDL_WINDOW_TRANSPARENT", - "value": "SDL_UINT64_C(0x0000000040000000)", + "value": "(1u << 30)", "comment": "window with transparent buffer" }, { "name": "SDL_WINDOW_NOT_FOCUSABLE", - "value": "SDL_UINT64_C(0x0000000080000000)", + "value": "(1u << 31)", "comment": "window should not be focusable" } ] -- 2.40.1 From fa4d485d2941e10782c7c3e4ea01ee6c9e97062a Mon Sep 17 00:00:00 2001 From: Peterino2 Date: Fri, 13 Nov 2026 02:56:42 +0000 Subject: [PATCH 2/2] Add bindings for SDL 3.4.2 through 3.4.20 castholm: v0.4.1+3.4.2, v0.4.2+3.4.4, v0.5.0+3.4.8, v0.5.1+3.4.10, v0.5.2+3.4.12, v0.5.3+3.4.14, v0.5.4+3.4.16, v0.6.0+3.4.18, v0.6.1+3.4.20 official: release-3.4.2, 3.4.4, 3.4.6, 3.4.8, 3.4.10, 3.4.12, 3.4.14, 3.4.16, 3.4.18, 3.4.20 --- castholm/v0.4.1-3.4.2/api/audio.zig | 271 ++ castholm/v0.4.1-3.4.2/api/blendmode.zig | 28 + castholm/v0.4.1-3.4.2/api/c.zig | 1 + castholm/v0.4.1-3.4.2/api/camera.zig | 95 + castholm/v0.4.1-3.4.2/api/clipboard.zig | 49 + castholm/v0.4.1-3.4.2/api/dialog.zig | 36 + castholm/v0.4.1-3.4.2/api/endian.zig | 2 + castholm/v0.4.1-3.4.2/api/error.zig | 18 + castholm/v0.4.1-3.4.2/api/events.zig | 687 +++ castholm/v0.4.1-3.4.2/api/filesystem.zig | 95 + castholm/v0.4.1-3.4.2/api/gamepad.zig | 390 ++ castholm/v0.4.1-3.4.2/api/gpu.zig | 1123 +++++ castholm/v0.4.1-3.4.2/api/guid.zig | 13 + castholm/v0.4.1-3.4.2/api/haptic.zig | 239 ++ castholm/v0.4.1-3.4.2/api/hints.zig | 41 + castholm/v0.4.1-3.4.2/api/init.zig | 75 + castholm/v0.4.1-3.4.2/api/iostream.zig | 221 + castholm/v0.4.1-3.4.2/api/joystick.zig | 307 ++ castholm/v0.4.1-3.4.2/api/keyboard.zig | 131 + castholm/v0.4.1-3.4.2/api/keycode.zig | 5 + castholm/v0.4.1-3.4.2/api/loadso.zig | 19 + castholm/v0.4.1-3.4.2/api/messagebox.zig | 70 + castholm/v0.4.1-3.4.2/api/misc.zig | 5 + castholm/v0.4.1-3.4.2/api/mouse.zig | 155 + castholm/v0.4.1-3.4.2/api/opengl.zig | 2 + castholm/v0.4.1-3.4.2/api/pen.zig | 39 + castholm/v0.4.1-3.4.2/api/pixels.zig | 311 ++ castholm/v0.4.1-3.4.2/api/power.zig | 14 + castholm/v0.4.1-3.4.2/api/process.zig | 52 + castholm/v0.4.1-3.4.2/api/properties.zig | 100 + castholm/v0.4.1-3.4.2/api/rect.zig | 65 + castholm/v0.4.1-3.4.2/api/render.zig | 553 +++ castholm/v0.4.1-3.4.2/api/scancode.zig | 253 ++ castholm/v0.4.1-3.4.2/api/sensor.zig | 77 + castholm/v0.4.1-3.4.2/api/stdinc.zig | 3 + castholm/v0.4.1-3.4.2/api/storage.zig | 97 + castholm/v0.4.1-3.4.2/api/surface.zig | 305 ++ castholm/v0.4.1-3.4.2/api/system.zig | 160 + castholm/v0.4.1-3.4.2/api/time.zig | 64 + castholm/v0.4.1-3.4.2/api/timer.zig | 47 + castholm/v0.4.1-3.4.2/api/touch.zig | 35 + castholm/v0.4.1-3.4.2/api/tray.zig | 116 + castholm/v0.4.1-3.4.2/api/version.zig | 9 + castholm/v0.4.1-3.4.2/api/video.zig | 623 +++ castholm/v0.4.1-3.4.2/json/audio.json | 918 ++++ castholm/v0.4.1-3.4.2/json/blendmode.json | 134 + castholm/v0.4.1-3.4.2/json/camera.json | 248 ++ castholm/v0.4.1-3.4.2/json/clipboard.json | 125 + castholm/v0.4.1-3.4.2/json/dialog.json | 158 + castholm/v0.4.1-3.4.2/json/endian.json | 12 + castholm/v0.4.1-3.4.2/json/error.json | 28 + castholm/v0.4.1-3.4.2/json/events.json | 2529 +++++++++++ castholm/v0.4.1-3.4.2/json/filesystem.json | 287 ++ castholm/v0.4.1-3.4.2/json/gamepad.json | 1169 +++++ castholm/v0.4.1-3.4.2/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.4.1-3.4.2/json/guid.json | 51 + castholm/v0.4.1-3.4.2/json/haptic.json | 806 ++++ castholm/v0.4.1-3.4.2/json/hints.json | 139 + castholm/v0.4.1-3.4.2/json/init.json | 202 + castholm/v0.4.1-3.4.2/json/iostream.json | 737 ++++ castholm/v0.4.1-3.4.2/json/joystick.json | 973 +++++ castholm/v0.4.1-3.4.2/json/keyboard.json | 332 ++ castholm/v0.4.1-3.4.2/json/keycode.json | 21 + castholm/v0.4.1-3.4.2/json/loadso.json | 51 + castholm/v0.4.1-3.4.2/json/messagebox.json | 205 + castholm/v0.4.1-3.4.2/json/misc.json | 23 + castholm/v0.4.1-3.4.2/json/mouse.json | 440 ++ castholm/v0.4.1-3.4.2/json/opengl.json | 12 + castholm/v0.4.1-3.4.2/json/pen.json | 135 + castholm/v0.4.1-3.4.2/json/pixels.json | 1214 ++++++ castholm/v0.4.1-3.4.2/json/power.json | 58 + castholm/v0.4.1-3.4.2/json/process.json | 153 + castholm/v0.4.1-3.4.2/json/properties.json | 369 ++ castholm/v0.4.1-3.4.2/json/rect.json | 278 ++ castholm/v0.4.1-3.4.2/json/render.json | 1930 +++++++++ castholm/v0.4.1-3.4.2/json/scancode.json | 1083 +++++ castholm/v0.4.1-3.4.2/json/sensor.json | 207 + castholm/v0.4.1-3.4.2/json/storage.json | 349 ++ castholm/v0.4.1-3.4.2/json/surface.json | 1326 ++++++ castholm/v0.4.1-3.4.2/json/system.json | 359 ++ castholm/v0.4.1-3.4.2/json/time.json | 238 ++ castholm/v0.4.1-3.4.2/json/timer.json | 121 + castholm/v0.4.1-3.4.2/json/touch.json | 114 + castholm/v0.4.1-3.4.2/json/tray.json | 332 ++ castholm/v0.4.1-3.4.2/json/version.json | 23 + castholm/v0.4.1-3.4.2/json/video.json | 1894 +++++++++ castholm/v0.4.2-3.4.4/api/audio.zig | 271 ++ castholm/v0.4.2-3.4.4/api/blendmode.zig | 28 + castholm/v0.4.2-3.4.4/api/c.zig | 1 + castholm/v0.4.2-3.4.4/api/camera.zig | 95 + castholm/v0.4.2-3.4.4/api/clipboard.zig | 49 + castholm/v0.4.2-3.4.4/api/dialog.zig | 36 + castholm/v0.4.2-3.4.4/api/endian.zig | 2 + castholm/v0.4.2-3.4.4/api/error.zig | 18 + castholm/v0.4.2-3.4.4/api/events.zig | 687 +++ castholm/v0.4.2-3.4.4/api/filesystem.zig | 95 + castholm/v0.4.2-3.4.4/api/gamepad.zig | 390 ++ castholm/v0.4.2-3.4.4/api/gpu.zig | 1123 +++++ castholm/v0.4.2-3.4.4/api/guid.zig | 13 + castholm/v0.4.2-3.4.4/api/haptic.zig | 239 ++ castholm/v0.4.2-3.4.4/api/hints.zig | 41 + castholm/v0.4.2-3.4.4/api/init.zig | 75 + castholm/v0.4.2-3.4.4/api/iostream.zig | 221 + castholm/v0.4.2-3.4.4/api/joystick.zig | 307 ++ castholm/v0.4.2-3.4.4/api/keyboard.zig | 131 + castholm/v0.4.2-3.4.4/api/keycode.zig | 5 + castholm/v0.4.2-3.4.4/api/loadso.zig | 19 + castholm/v0.4.2-3.4.4/api/messagebox.zig | 70 + castholm/v0.4.2-3.4.4/api/misc.zig | 5 + castholm/v0.4.2-3.4.4/api/mouse.zig | 155 + castholm/v0.4.2-3.4.4/api/opengl.zig | 2 + castholm/v0.4.2-3.4.4/api/pen.zig | 39 + castholm/v0.4.2-3.4.4/api/pixels.zig | 311 ++ castholm/v0.4.2-3.4.4/api/power.zig | 14 + castholm/v0.4.2-3.4.4/api/process.zig | 52 + castholm/v0.4.2-3.4.4/api/properties.zig | 100 + castholm/v0.4.2-3.4.4/api/rect.zig | 65 + castholm/v0.4.2-3.4.4/api/render.zig | 553 +++ castholm/v0.4.2-3.4.4/api/scancode.zig | 253 ++ castholm/v0.4.2-3.4.4/api/sensor.zig | 77 + castholm/v0.4.2-3.4.4/api/stdinc.zig | 3 + castholm/v0.4.2-3.4.4/api/storage.zig | 97 + castholm/v0.4.2-3.4.4/api/surface.zig | 305 ++ castholm/v0.4.2-3.4.4/api/system.zig | 160 + castholm/v0.4.2-3.4.4/api/time.zig | 64 + castholm/v0.4.2-3.4.4/api/timer.zig | 47 + castholm/v0.4.2-3.4.4/api/touch.zig | 35 + castholm/v0.4.2-3.4.4/api/tray.zig | 116 + castholm/v0.4.2-3.4.4/api/version.zig | 9 + castholm/v0.4.2-3.4.4/api/video.zig | 623 +++ castholm/v0.4.2-3.4.4/json/audio.json | 918 ++++ castholm/v0.4.2-3.4.4/json/blendmode.json | 134 + castholm/v0.4.2-3.4.4/json/camera.json | 248 ++ castholm/v0.4.2-3.4.4/json/clipboard.json | 125 + castholm/v0.4.2-3.4.4/json/dialog.json | 158 + castholm/v0.4.2-3.4.4/json/endian.json | 12 + castholm/v0.4.2-3.4.4/json/error.json | 28 + castholm/v0.4.2-3.4.4/json/events.json | 2529 +++++++++++ castholm/v0.4.2-3.4.4/json/filesystem.json | 287 ++ castholm/v0.4.2-3.4.4/json/gamepad.json | 1169 +++++ castholm/v0.4.2-3.4.4/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.4.2-3.4.4/json/guid.json | 51 + castholm/v0.4.2-3.4.4/json/haptic.json | 806 ++++ castholm/v0.4.2-3.4.4/json/hints.json | 139 + castholm/v0.4.2-3.4.4/json/init.json | 202 + castholm/v0.4.2-3.4.4/json/iostream.json | 737 ++++ castholm/v0.4.2-3.4.4/json/joystick.json | 973 +++++ castholm/v0.4.2-3.4.4/json/keyboard.json | 332 ++ castholm/v0.4.2-3.4.4/json/keycode.json | 21 + castholm/v0.4.2-3.4.4/json/loadso.json | 51 + castholm/v0.4.2-3.4.4/json/messagebox.json | 205 + castholm/v0.4.2-3.4.4/json/misc.json | 23 + castholm/v0.4.2-3.4.4/json/mouse.json | 440 ++ castholm/v0.4.2-3.4.4/json/opengl.json | 12 + castholm/v0.4.2-3.4.4/json/pen.json | 135 + castholm/v0.4.2-3.4.4/json/pixels.json | 1214 ++++++ castholm/v0.4.2-3.4.4/json/power.json | 58 + castholm/v0.4.2-3.4.4/json/process.json | 153 + castholm/v0.4.2-3.4.4/json/properties.json | 369 ++ castholm/v0.4.2-3.4.4/json/rect.json | 278 ++ castholm/v0.4.2-3.4.4/json/render.json | 1930 +++++++++ castholm/v0.4.2-3.4.4/json/scancode.json | 1083 +++++ castholm/v0.4.2-3.4.4/json/sensor.json | 207 + castholm/v0.4.2-3.4.4/json/storage.json | 349 ++ castholm/v0.4.2-3.4.4/json/surface.json | 1326 ++++++ castholm/v0.4.2-3.4.4/json/system.json | 359 ++ castholm/v0.4.2-3.4.4/json/time.json | 238 ++ castholm/v0.4.2-3.4.4/json/timer.json | 121 + castholm/v0.4.2-3.4.4/json/touch.json | 114 + castholm/v0.4.2-3.4.4/json/tray.json | 332 ++ castholm/v0.4.2-3.4.4/json/version.json | 23 + castholm/v0.4.2-3.4.4/json/video.json | 1894 +++++++++ castholm/v0.5.0-3.4.8/api/audio.zig | 271 ++ castholm/v0.5.0-3.4.8/api/blendmode.zig | 28 + castholm/v0.5.0-3.4.8/api/c.zig | 1 + castholm/v0.5.0-3.4.8/api/camera.zig | 95 + castholm/v0.5.0-3.4.8/api/clipboard.zig | 49 + castholm/v0.5.0-3.4.8/api/dialog.zig | 36 + castholm/v0.5.0-3.4.8/api/endian.zig | 2 + castholm/v0.5.0-3.4.8/api/error.zig | 18 + castholm/v0.5.0-3.4.8/api/events.zig | 687 +++ castholm/v0.5.0-3.4.8/api/filesystem.zig | 95 + castholm/v0.5.0-3.4.8/api/gamepad.zig | 390 ++ castholm/v0.5.0-3.4.8/api/gpu.zig | 1123 +++++ castholm/v0.5.0-3.4.8/api/guid.zig | 13 + castholm/v0.5.0-3.4.8/api/haptic.zig | 239 ++ castholm/v0.5.0-3.4.8/api/hints.zig | 41 + castholm/v0.5.0-3.4.8/api/init.zig | 75 + castholm/v0.5.0-3.4.8/api/iostream.zig | 221 + castholm/v0.5.0-3.4.8/api/joystick.zig | 307 ++ castholm/v0.5.0-3.4.8/api/keyboard.zig | 131 + castholm/v0.5.0-3.4.8/api/keycode.zig | 5 + castholm/v0.5.0-3.4.8/api/loadso.zig | 19 + castholm/v0.5.0-3.4.8/api/messagebox.zig | 70 + castholm/v0.5.0-3.4.8/api/misc.zig | 5 + castholm/v0.5.0-3.4.8/api/mouse.zig | 155 + castholm/v0.5.0-3.4.8/api/opengl.zig | 2 + castholm/v0.5.0-3.4.8/api/pen.zig | 39 + castholm/v0.5.0-3.4.8/api/pixels.zig | 311 ++ castholm/v0.5.0-3.4.8/api/power.zig | 14 + castholm/v0.5.0-3.4.8/api/process.zig | 52 + castholm/v0.5.0-3.4.8/api/properties.zig | 100 + castholm/v0.5.0-3.4.8/api/rect.zig | 65 + castholm/v0.5.0-3.4.8/api/render.zig | 553 +++ castholm/v0.5.0-3.4.8/api/scancode.zig | 253 ++ castholm/v0.5.0-3.4.8/api/sensor.zig | 77 + castholm/v0.5.0-3.4.8/api/stdinc.zig | 3 + castholm/v0.5.0-3.4.8/api/storage.zig | 97 + castholm/v0.5.0-3.4.8/api/surface.zig | 305 ++ castholm/v0.5.0-3.4.8/api/system.zig | 160 + castholm/v0.5.0-3.4.8/api/time.zig | 64 + castholm/v0.5.0-3.4.8/api/timer.zig | 47 + castholm/v0.5.0-3.4.8/api/touch.zig | 35 + castholm/v0.5.0-3.4.8/api/tray.zig | 116 + castholm/v0.5.0-3.4.8/api/version.zig | 9 + castholm/v0.5.0-3.4.8/api/video.zig | 623 +++ castholm/v0.5.0-3.4.8/json/audio.json | 918 ++++ castholm/v0.5.0-3.4.8/json/blendmode.json | 134 + castholm/v0.5.0-3.4.8/json/camera.json | 248 ++ castholm/v0.5.0-3.4.8/json/clipboard.json | 125 + castholm/v0.5.0-3.4.8/json/dialog.json | 158 + castholm/v0.5.0-3.4.8/json/endian.json | 12 + castholm/v0.5.0-3.4.8/json/error.json | 28 + castholm/v0.5.0-3.4.8/json/events.json | 2529 +++++++++++ castholm/v0.5.0-3.4.8/json/filesystem.json | 287 ++ castholm/v0.5.0-3.4.8/json/gamepad.json | 1169 +++++ castholm/v0.5.0-3.4.8/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.5.0-3.4.8/json/guid.json | 51 + castholm/v0.5.0-3.4.8/json/haptic.json | 806 ++++ castholm/v0.5.0-3.4.8/json/hints.json | 139 + castholm/v0.5.0-3.4.8/json/init.json | 202 + castholm/v0.5.0-3.4.8/json/iostream.json | 737 ++++ castholm/v0.5.0-3.4.8/json/joystick.json | 973 +++++ castholm/v0.5.0-3.4.8/json/keyboard.json | 332 ++ castholm/v0.5.0-3.4.8/json/keycode.json | 21 + castholm/v0.5.0-3.4.8/json/loadso.json | 51 + castholm/v0.5.0-3.4.8/json/messagebox.json | 205 + castholm/v0.5.0-3.4.8/json/misc.json | 23 + castholm/v0.5.0-3.4.8/json/mouse.json | 440 ++ castholm/v0.5.0-3.4.8/json/opengl.json | 12 + castholm/v0.5.0-3.4.8/json/pen.json | 135 + castholm/v0.5.0-3.4.8/json/pixels.json | 1214 ++++++ castholm/v0.5.0-3.4.8/json/power.json | 58 + castholm/v0.5.0-3.4.8/json/process.json | 153 + castholm/v0.5.0-3.4.8/json/properties.json | 369 ++ castholm/v0.5.0-3.4.8/json/rect.json | 278 ++ castholm/v0.5.0-3.4.8/json/render.json | 1930 +++++++++ castholm/v0.5.0-3.4.8/json/scancode.json | 1083 +++++ castholm/v0.5.0-3.4.8/json/sensor.json | 207 + castholm/v0.5.0-3.4.8/json/storage.json | 349 ++ castholm/v0.5.0-3.4.8/json/surface.json | 1326 ++++++ castholm/v0.5.0-3.4.8/json/system.json | 359 ++ castholm/v0.5.0-3.4.8/json/time.json | 238 ++ castholm/v0.5.0-3.4.8/json/timer.json | 121 + castholm/v0.5.0-3.4.8/json/touch.json | 114 + castholm/v0.5.0-3.4.8/json/tray.json | 332 ++ castholm/v0.5.0-3.4.8/json/version.json | 23 + castholm/v0.5.0-3.4.8/json/video.json | 1894 +++++++++ castholm/v0.5.1-3.4.10/api/audio.zig | 271 ++ castholm/v0.5.1-3.4.10/api/blendmode.zig | 28 + castholm/v0.5.1-3.4.10/api/c.zig | 1 + castholm/v0.5.1-3.4.10/api/camera.zig | 95 + castholm/v0.5.1-3.4.10/api/clipboard.zig | 49 + castholm/v0.5.1-3.4.10/api/dialog.zig | 36 + castholm/v0.5.1-3.4.10/api/endian.zig | 2 + castholm/v0.5.1-3.4.10/api/error.zig | 18 + castholm/v0.5.1-3.4.10/api/events.zig | 687 +++ castholm/v0.5.1-3.4.10/api/filesystem.zig | 95 + castholm/v0.5.1-3.4.10/api/gamepad.zig | 390 ++ castholm/v0.5.1-3.4.10/api/gpu.zig | 1123 +++++ castholm/v0.5.1-3.4.10/api/guid.zig | 13 + castholm/v0.5.1-3.4.10/api/haptic.zig | 239 ++ castholm/v0.5.1-3.4.10/api/hints.zig | 41 + castholm/v0.5.1-3.4.10/api/init.zig | 75 + castholm/v0.5.1-3.4.10/api/iostream.zig | 221 + castholm/v0.5.1-3.4.10/api/joystick.zig | 307 ++ castholm/v0.5.1-3.4.10/api/keyboard.zig | 131 + castholm/v0.5.1-3.4.10/api/keycode.zig | 5 + castholm/v0.5.1-3.4.10/api/loadso.zig | 19 + castholm/v0.5.1-3.4.10/api/messagebox.zig | 70 + castholm/v0.5.1-3.4.10/api/misc.zig | 5 + castholm/v0.5.1-3.4.10/api/mouse.zig | 155 + castholm/v0.5.1-3.4.10/api/opengl.zig | 2 + castholm/v0.5.1-3.4.10/api/pen.zig | 39 + castholm/v0.5.1-3.4.10/api/pixels.zig | 311 ++ castholm/v0.5.1-3.4.10/api/power.zig | 14 + castholm/v0.5.1-3.4.10/api/process.zig | 52 + castholm/v0.5.1-3.4.10/api/properties.zig | 100 + castholm/v0.5.1-3.4.10/api/rect.zig | 65 + castholm/v0.5.1-3.4.10/api/render.zig | 553 +++ castholm/v0.5.1-3.4.10/api/scancode.zig | 253 ++ castholm/v0.5.1-3.4.10/api/sensor.zig | 77 + castholm/v0.5.1-3.4.10/api/stdinc.zig | 3 + castholm/v0.5.1-3.4.10/api/storage.zig | 97 + castholm/v0.5.1-3.4.10/api/surface.zig | 305 ++ castholm/v0.5.1-3.4.10/api/system.zig | 160 + castholm/v0.5.1-3.4.10/api/time.zig | 64 + castholm/v0.5.1-3.4.10/api/timer.zig | 47 + castholm/v0.5.1-3.4.10/api/touch.zig | 35 + castholm/v0.5.1-3.4.10/api/tray.zig | 116 + castholm/v0.5.1-3.4.10/api/version.zig | 9 + castholm/v0.5.1-3.4.10/api/video.zig | 623 +++ castholm/v0.5.1-3.4.10/json/audio.json | 918 ++++ castholm/v0.5.1-3.4.10/json/blendmode.json | 134 + castholm/v0.5.1-3.4.10/json/camera.json | 248 ++ castholm/v0.5.1-3.4.10/json/clipboard.json | 125 + castholm/v0.5.1-3.4.10/json/dialog.json | 158 + castholm/v0.5.1-3.4.10/json/endian.json | 12 + castholm/v0.5.1-3.4.10/json/error.json | 28 + castholm/v0.5.1-3.4.10/json/events.json | 2529 +++++++++++ castholm/v0.5.1-3.4.10/json/filesystem.json | 287 ++ castholm/v0.5.1-3.4.10/json/gamepad.json | 1169 +++++ castholm/v0.5.1-3.4.10/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.5.1-3.4.10/json/guid.json | 51 + castholm/v0.5.1-3.4.10/json/haptic.json | 806 ++++ castholm/v0.5.1-3.4.10/json/hints.json | 139 + castholm/v0.5.1-3.4.10/json/init.json | 202 + castholm/v0.5.1-3.4.10/json/iostream.json | 737 ++++ castholm/v0.5.1-3.4.10/json/joystick.json | 973 +++++ castholm/v0.5.1-3.4.10/json/keyboard.json | 332 ++ castholm/v0.5.1-3.4.10/json/keycode.json | 21 + castholm/v0.5.1-3.4.10/json/loadso.json | 51 + castholm/v0.5.1-3.4.10/json/messagebox.json | 205 + castholm/v0.5.1-3.4.10/json/misc.json | 23 + castholm/v0.5.1-3.4.10/json/mouse.json | 440 ++ castholm/v0.5.1-3.4.10/json/opengl.json | 12 + castholm/v0.5.1-3.4.10/json/pen.json | 135 + castholm/v0.5.1-3.4.10/json/pixels.json | 1214 ++++++ castholm/v0.5.1-3.4.10/json/power.json | 58 + castholm/v0.5.1-3.4.10/json/process.json | 153 + castholm/v0.5.1-3.4.10/json/properties.json | 369 ++ castholm/v0.5.1-3.4.10/json/rect.json | 278 ++ castholm/v0.5.1-3.4.10/json/render.json | 1930 +++++++++ castholm/v0.5.1-3.4.10/json/scancode.json | 1083 +++++ castholm/v0.5.1-3.4.10/json/sensor.json | 207 + castholm/v0.5.1-3.4.10/json/storage.json | 349 ++ castholm/v0.5.1-3.4.10/json/surface.json | 1326 ++++++ castholm/v0.5.1-3.4.10/json/system.json | 359 ++ castholm/v0.5.1-3.4.10/json/time.json | 238 ++ castholm/v0.5.1-3.4.10/json/timer.json | 121 + castholm/v0.5.1-3.4.10/json/touch.json | 114 + castholm/v0.5.1-3.4.10/json/tray.json | 332 ++ castholm/v0.5.1-3.4.10/json/version.json | 23 + castholm/v0.5.1-3.4.10/json/video.json | 1894 +++++++++ castholm/v0.5.2-3.4.12/api/audio.zig | 271 ++ castholm/v0.5.2-3.4.12/api/blendmode.zig | 28 + castholm/v0.5.2-3.4.12/api/c.zig | 1 + castholm/v0.5.2-3.4.12/api/camera.zig | 95 + castholm/v0.5.2-3.4.12/api/clipboard.zig | 49 + castholm/v0.5.2-3.4.12/api/dialog.zig | 36 + castholm/v0.5.2-3.4.12/api/endian.zig | 2 + castholm/v0.5.2-3.4.12/api/error.zig | 18 + castholm/v0.5.2-3.4.12/api/events.zig | 687 +++ castholm/v0.5.2-3.4.12/api/filesystem.zig | 95 + castholm/v0.5.2-3.4.12/api/gamepad.zig | 390 ++ castholm/v0.5.2-3.4.12/api/gpu.zig | 1123 +++++ castholm/v0.5.2-3.4.12/api/guid.zig | 13 + castholm/v0.5.2-3.4.12/api/haptic.zig | 239 ++ castholm/v0.5.2-3.4.12/api/hints.zig | 41 + castholm/v0.5.2-3.4.12/api/init.zig | 75 + castholm/v0.5.2-3.4.12/api/iostream.zig | 221 + castholm/v0.5.2-3.4.12/api/joystick.zig | 307 ++ castholm/v0.5.2-3.4.12/api/keyboard.zig | 131 + castholm/v0.5.2-3.4.12/api/keycode.zig | 5 + castholm/v0.5.2-3.4.12/api/loadso.zig | 19 + castholm/v0.5.2-3.4.12/api/messagebox.zig | 70 + castholm/v0.5.2-3.4.12/api/misc.zig | 5 + castholm/v0.5.2-3.4.12/api/mouse.zig | 155 + castholm/v0.5.2-3.4.12/api/opengl.zig | 2 + castholm/v0.5.2-3.4.12/api/pen.zig | 39 + castholm/v0.5.2-3.4.12/api/pixels.zig | 311 ++ castholm/v0.5.2-3.4.12/api/power.zig | 14 + castholm/v0.5.2-3.4.12/api/process.zig | 52 + castholm/v0.5.2-3.4.12/api/properties.zig | 100 + castholm/v0.5.2-3.4.12/api/rect.zig | 65 + castholm/v0.5.2-3.4.12/api/render.zig | 553 +++ castholm/v0.5.2-3.4.12/api/scancode.zig | 253 ++ castholm/v0.5.2-3.4.12/api/sensor.zig | 77 + castholm/v0.5.2-3.4.12/api/stdinc.zig | 3 + castholm/v0.5.2-3.4.12/api/storage.zig | 97 + castholm/v0.5.2-3.4.12/api/surface.zig | 305 ++ castholm/v0.5.2-3.4.12/api/system.zig | 160 + castholm/v0.5.2-3.4.12/api/time.zig | 64 + castholm/v0.5.2-3.4.12/api/timer.zig | 47 + castholm/v0.5.2-3.4.12/api/touch.zig | 35 + castholm/v0.5.2-3.4.12/api/tray.zig | 116 + castholm/v0.5.2-3.4.12/api/version.zig | 9 + castholm/v0.5.2-3.4.12/api/video.zig | 623 +++ castholm/v0.5.2-3.4.12/json/audio.json | 918 ++++ castholm/v0.5.2-3.4.12/json/blendmode.json | 134 + castholm/v0.5.2-3.4.12/json/camera.json | 248 ++ castholm/v0.5.2-3.4.12/json/clipboard.json | 125 + castholm/v0.5.2-3.4.12/json/dialog.json | 158 + castholm/v0.5.2-3.4.12/json/endian.json | 12 + castholm/v0.5.2-3.4.12/json/error.json | 28 + castholm/v0.5.2-3.4.12/json/events.json | 2529 +++++++++++ castholm/v0.5.2-3.4.12/json/filesystem.json | 287 ++ castholm/v0.5.2-3.4.12/json/gamepad.json | 1169 +++++ castholm/v0.5.2-3.4.12/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.5.2-3.4.12/json/guid.json | 51 + castholm/v0.5.2-3.4.12/json/haptic.json | 806 ++++ castholm/v0.5.2-3.4.12/json/hints.json | 139 + castholm/v0.5.2-3.4.12/json/init.json | 202 + castholm/v0.5.2-3.4.12/json/iostream.json | 737 ++++ castholm/v0.5.2-3.4.12/json/joystick.json | 973 +++++ castholm/v0.5.2-3.4.12/json/keyboard.json | 332 ++ castholm/v0.5.2-3.4.12/json/keycode.json | 21 + castholm/v0.5.2-3.4.12/json/loadso.json | 51 + castholm/v0.5.2-3.4.12/json/messagebox.json | 205 + castholm/v0.5.2-3.4.12/json/misc.json | 23 + castholm/v0.5.2-3.4.12/json/mouse.json | 440 ++ castholm/v0.5.2-3.4.12/json/opengl.json | 12 + castholm/v0.5.2-3.4.12/json/pen.json | 135 + castholm/v0.5.2-3.4.12/json/pixels.json | 1214 ++++++ castholm/v0.5.2-3.4.12/json/power.json | 58 + castholm/v0.5.2-3.4.12/json/process.json | 153 + castholm/v0.5.2-3.4.12/json/properties.json | 369 ++ castholm/v0.5.2-3.4.12/json/rect.json | 278 ++ castholm/v0.5.2-3.4.12/json/render.json | 1930 +++++++++ castholm/v0.5.2-3.4.12/json/scancode.json | 1083 +++++ castholm/v0.5.2-3.4.12/json/sensor.json | 207 + castholm/v0.5.2-3.4.12/json/storage.json | 349 ++ castholm/v0.5.2-3.4.12/json/surface.json | 1326 ++++++ castholm/v0.5.2-3.4.12/json/system.json | 359 ++ castholm/v0.5.2-3.4.12/json/time.json | 238 ++ castholm/v0.5.2-3.4.12/json/timer.json | 121 + castholm/v0.5.2-3.4.12/json/touch.json | 114 + castholm/v0.5.2-3.4.12/json/tray.json | 332 ++ castholm/v0.5.2-3.4.12/json/version.json | 23 + castholm/v0.5.2-3.4.12/json/video.json | 1894 +++++++++ castholm/v0.5.3-3.4.14/api/audio.zig | 271 ++ castholm/v0.5.3-3.4.14/api/blendmode.zig | 28 + castholm/v0.5.3-3.4.14/api/c.zig | 1 + castholm/v0.5.3-3.4.14/api/camera.zig | 95 + castholm/v0.5.3-3.4.14/api/clipboard.zig | 49 + castholm/v0.5.3-3.4.14/api/dialog.zig | 36 + castholm/v0.5.3-3.4.14/api/endian.zig | 2 + castholm/v0.5.3-3.4.14/api/error.zig | 18 + castholm/v0.5.3-3.4.14/api/events.zig | 687 +++ castholm/v0.5.3-3.4.14/api/filesystem.zig | 95 + castholm/v0.5.3-3.4.14/api/gamepad.zig | 390 ++ castholm/v0.5.3-3.4.14/api/gpu.zig | 1123 +++++ castholm/v0.5.3-3.4.14/api/guid.zig | 13 + castholm/v0.5.3-3.4.14/api/haptic.zig | 239 ++ castholm/v0.5.3-3.4.14/api/hints.zig | 41 + castholm/v0.5.3-3.4.14/api/init.zig | 75 + castholm/v0.5.3-3.4.14/api/iostream.zig | 221 + castholm/v0.5.3-3.4.14/api/joystick.zig | 307 ++ castholm/v0.5.3-3.4.14/api/keyboard.zig | 131 + castholm/v0.5.3-3.4.14/api/keycode.zig | 5 + castholm/v0.5.3-3.4.14/api/loadso.zig | 19 + castholm/v0.5.3-3.4.14/api/messagebox.zig | 70 + castholm/v0.5.3-3.4.14/api/misc.zig | 5 + castholm/v0.5.3-3.4.14/api/mouse.zig | 155 + castholm/v0.5.3-3.4.14/api/opengl.zig | 2 + castholm/v0.5.3-3.4.14/api/pen.zig | 39 + castholm/v0.5.3-3.4.14/api/pixels.zig | 311 ++ castholm/v0.5.3-3.4.14/api/power.zig | 14 + castholm/v0.5.3-3.4.14/api/process.zig | 52 + castholm/v0.5.3-3.4.14/api/properties.zig | 100 + castholm/v0.5.3-3.4.14/api/rect.zig | 65 + castholm/v0.5.3-3.4.14/api/render.zig | 553 +++ castholm/v0.5.3-3.4.14/api/scancode.zig | 253 ++ castholm/v0.5.3-3.4.14/api/sensor.zig | 77 + castholm/v0.5.3-3.4.14/api/stdinc.zig | 3 + castholm/v0.5.3-3.4.14/api/storage.zig | 97 + castholm/v0.5.3-3.4.14/api/surface.zig | 305 ++ castholm/v0.5.3-3.4.14/api/system.zig | 160 + castholm/v0.5.3-3.4.14/api/time.zig | 64 + castholm/v0.5.3-3.4.14/api/timer.zig | 47 + castholm/v0.5.3-3.4.14/api/touch.zig | 35 + castholm/v0.5.3-3.4.14/api/tray.zig | 116 + castholm/v0.5.3-3.4.14/api/version.zig | 9 + castholm/v0.5.3-3.4.14/api/video.zig | 623 +++ castholm/v0.5.3-3.4.14/json/audio.json | 918 ++++ castholm/v0.5.3-3.4.14/json/blendmode.json | 134 + castholm/v0.5.3-3.4.14/json/camera.json | 248 ++ castholm/v0.5.3-3.4.14/json/clipboard.json | 125 + castholm/v0.5.3-3.4.14/json/dialog.json | 158 + castholm/v0.5.3-3.4.14/json/endian.json | 12 + castholm/v0.5.3-3.4.14/json/error.json | 28 + castholm/v0.5.3-3.4.14/json/events.json | 2529 +++++++++++ castholm/v0.5.3-3.4.14/json/filesystem.json | 287 ++ castholm/v0.5.3-3.4.14/json/gamepad.json | 1169 +++++ castholm/v0.5.3-3.4.14/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.5.3-3.4.14/json/guid.json | 51 + castholm/v0.5.3-3.4.14/json/haptic.json | 806 ++++ castholm/v0.5.3-3.4.14/json/hints.json | 139 + castholm/v0.5.3-3.4.14/json/init.json | 202 + castholm/v0.5.3-3.4.14/json/iostream.json | 737 ++++ castholm/v0.5.3-3.4.14/json/joystick.json | 973 +++++ castholm/v0.5.3-3.4.14/json/keyboard.json | 332 ++ castholm/v0.5.3-3.4.14/json/keycode.json | 21 + castholm/v0.5.3-3.4.14/json/loadso.json | 51 + castholm/v0.5.3-3.4.14/json/messagebox.json | 205 + castholm/v0.5.3-3.4.14/json/misc.json | 23 + castholm/v0.5.3-3.4.14/json/mouse.json | 440 ++ castholm/v0.5.3-3.4.14/json/opengl.json | 12 + castholm/v0.5.3-3.4.14/json/pen.json | 135 + castholm/v0.5.3-3.4.14/json/pixels.json | 1214 ++++++ castholm/v0.5.3-3.4.14/json/power.json | 58 + castholm/v0.5.3-3.4.14/json/process.json | 153 + castholm/v0.5.3-3.4.14/json/properties.json | 369 ++ castholm/v0.5.3-3.4.14/json/rect.json | 278 ++ castholm/v0.5.3-3.4.14/json/render.json | 1930 +++++++++ castholm/v0.5.3-3.4.14/json/scancode.json | 1083 +++++ castholm/v0.5.3-3.4.14/json/sensor.json | 207 + castholm/v0.5.3-3.4.14/json/storage.json | 349 ++ castholm/v0.5.3-3.4.14/json/surface.json | 1326 ++++++ castholm/v0.5.3-3.4.14/json/system.json | 359 ++ castholm/v0.5.3-3.4.14/json/time.json | 238 ++ castholm/v0.5.3-3.4.14/json/timer.json | 121 + castholm/v0.5.3-3.4.14/json/touch.json | 114 + castholm/v0.5.3-3.4.14/json/tray.json | 332 ++ castholm/v0.5.3-3.4.14/json/version.json | 23 + castholm/v0.5.3-3.4.14/json/video.json | 1894 +++++++++ castholm/v0.5.4-3.4.16/api/audio.zig | 271 ++ castholm/v0.5.4-3.4.16/api/blendmode.zig | 28 + castholm/v0.5.4-3.4.16/api/c.zig | 1 + castholm/v0.5.4-3.4.16/api/camera.zig | 95 + castholm/v0.5.4-3.4.16/api/clipboard.zig | 49 + castholm/v0.5.4-3.4.16/api/dialog.zig | 36 + castholm/v0.5.4-3.4.16/api/endian.zig | 2 + castholm/v0.5.4-3.4.16/api/error.zig | 18 + castholm/v0.5.4-3.4.16/api/events.zig | 688 +++ castholm/v0.5.4-3.4.16/api/filesystem.zig | 95 + castholm/v0.5.4-3.4.16/api/gamepad.zig | 390 ++ castholm/v0.5.4-3.4.16/api/gpu.zig | 1123 +++++ castholm/v0.5.4-3.4.16/api/guid.zig | 13 + castholm/v0.5.4-3.4.16/api/haptic.zig | 239 ++ castholm/v0.5.4-3.4.16/api/hints.zig | 41 + castholm/v0.5.4-3.4.16/api/init.zig | 75 + castholm/v0.5.4-3.4.16/api/iostream.zig | 221 + castholm/v0.5.4-3.4.16/api/joystick.zig | 307 ++ castholm/v0.5.4-3.4.16/api/keyboard.zig | 131 + castholm/v0.5.4-3.4.16/api/keycode.zig | 5 + castholm/v0.5.4-3.4.16/api/loadso.zig | 19 + castholm/v0.5.4-3.4.16/api/messagebox.zig | 70 + castholm/v0.5.4-3.4.16/api/misc.zig | 5 + castholm/v0.5.4-3.4.16/api/mouse.zig | 155 + castholm/v0.5.4-3.4.16/api/opengl.zig | 2 + castholm/v0.5.4-3.4.16/api/pen.zig | 39 + castholm/v0.5.4-3.4.16/api/pixels.zig | 311 ++ castholm/v0.5.4-3.4.16/api/power.zig | 14 + castholm/v0.5.4-3.4.16/api/process.zig | 52 + castholm/v0.5.4-3.4.16/api/properties.zig | 100 + castholm/v0.5.4-3.4.16/api/rect.zig | 65 + castholm/v0.5.4-3.4.16/api/render.zig | 553 +++ castholm/v0.5.4-3.4.16/api/scancode.zig | 253 ++ castholm/v0.5.4-3.4.16/api/sensor.zig | 77 + castholm/v0.5.4-3.4.16/api/stdinc.zig | 3 + castholm/v0.5.4-3.4.16/api/storage.zig | 97 + castholm/v0.5.4-3.4.16/api/surface.zig | 305 ++ castholm/v0.5.4-3.4.16/api/system.zig | 160 + castholm/v0.5.4-3.4.16/api/time.zig | 64 + castholm/v0.5.4-3.4.16/api/timer.zig | 47 + castholm/v0.5.4-3.4.16/api/touch.zig | 35 + castholm/v0.5.4-3.4.16/api/tray.zig | 116 + castholm/v0.5.4-3.4.16/api/version.zig | 9 + castholm/v0.5.4-3.4.16/api/video.zig | 623 +++ castholm/v0.5.4-3.4.16/json/audio.json | 918 ++++ castholm/v0.5.4-3.4.16/json/blendmode.json | 134 + castholm/v0.5.4-3.4.16/json/camera.json | 248 ++ castholm/v0.5.4-3.4.16/json/clipboard.json | 125 + castholm/v0.5.4-3.4.16/json/dialog.json | 158 + castholm/v0.5.4-3.4.16/json/endian.json | 12 + castholm/v0.5.4-3.4.16/json/error.json | 28 + castholm/v0.5.4-3.4.16/json/events.json | 2534 +++++++++++ castholm/v0.5.4-3.4.16/json/filesystem.json | 287 ++ castholm/v0.5.4-3.4.16/json/gamepad.json | 1169 +++++ castholm/v0.5.4-3.4.16/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.5.4-3.4.16/json/guid.json | 51 + castholm/v0.5.4-3.4.16/json/haptic.json | 806 ++++ castholm/v0.5.4-3.4.16/json/hints.json | 139 + castholm/v0.5.4-3.4.16/json/init.json | 202 + castholm/v0.5.4-3.4.16/json/iostream.json | 737 ++++ castholm/v0.5.4-3.4.16/json/joystick.json | 973 +++++ castholm/v0.5.4-3.4.16/json/keyboard.json | 332 ++ castholm/v0.5.4-3.4.16/json/keycode.json | 21 + castholm/v0.5.4-3.4.16/json/loadso.json | 51 + castholm/v0.5.4-3.4.16/json/messagebox.json | 205 + castholm/v0.5.4-3.4.16/json/misc.json | 23 + castholm/v0.5.4-3.4.16/json/mouse.json | 440 ++ castholm/v0.5.4-3.4.16/json/opengl.json | 12 + castholm/v0.5.4-3.4.16/json/pen.json | 135 + castholm/v0.5.4-3.4.16/json/pixels.json | 1214 ++++++ castholm/v0.5.4-3.4.16/json/power.json | 58 + castholm/v0.5.4-3.4.16/json/process.json | 153 + castholm/v0.5.4-3.4.16/json/properties.json | 369 ++ castholm/v0.5.4-3.4.16/json/rect.json | 278 ++ castholm/v0.5.4-3.4.16/json/render.json | 1930 +++++++++ castholm/v0.5.4-3.4.16/json/scancode.json | 1083 +++++ castholm/v0.5.4-3.4.16/json/sensor.json | 207 + castholm/v0.5.4-3.4.16/json/storage.json | 349 ++ castholm/v0.5.4-3.4.16/json/surface.json | 1326 ++++++ castholm/v0.5.4-3.4.16/json/system.json | 359 ++ castholm/v0.5.4-3.4.16/json/time.json | 238 ++ castholm/v0.5.4-3.4.16/json/timer.json | 121 + castholm/v0.5.4-3.4.16/json/touch.json | 114 + castholm/v0.5.4-3.4.16/json/tray.json | 332 ++ castholm/v0.5.4-3.4.16/json/version.json | 23 + castholm/v0.5.4-3.4.16/json/video.json | 1894 +++++++++ castholm/v0.6.0-3.4.18/api/audio.zig | 271 ++ castholm/v0.6.0-3.4.18/api/blendmode.zig | 28 + castholm/v0.6.0-3.4.18/api/c.zig | 1 + castholm/v0.6.0-3.4.18/api/camera.zig | 95 + castholm/v0.6.0-3.4.18/api/clipboard.zig | 49 + castholm/v0.6.0-3.4.18/api/dialog.zig | 36 + castholm/v0.6.0-3.4.18/api/endian.zig | 2 + castholm/v0.6.0-3.4.18/api/error.zig | 18 + castholm/v0.6.0-3.4.18/api/events.zig | 694 +++ castholm/v0.6.0-3.4.18/api/filesystem.zig | 95 + castholm/v0.6.0-3.4.18/api/gamepad.zig | 391 ++ castholm/v0.6.0-3.4.18/api/gpu.zig | 1123 +++++ castholm/v0.6.0-3.4.18/api/guid.zig | 13 + castholm/v0.6.0-3.4.18/api/haptic.zig | 239 ++ castholm/v0.6.0-3.4.18/api/hints.zig | 41 + castholm/v0.6.0-3.4.18/api/init.zig | 75 + castholm/v0.6.0-3.4.18/api/iostream.zig | 221 + castholm/v0.6.0-3.4.18/api/joystick.zig | 307 ++ castholm/v0.6.0-3.4.18/api/keyboard.zig | 131 + castholm/v0.6.0-3.4.18/api/keycode.zig | 5 + castholm/v0.6.0-3.4.18/api/loadso.zig | 19 + castholm/v0.6.0-3.4.18/api/messagebox.zig | 70 + castholm/v0.6.0-3.4.18/api/misc.zig | 5 + castholm/v0.6.0-3.4.18/api/mouse.zig | 155 + castholm/v0.6.0-3.4.18/api/opengl.zig | 2 + castholm/v0.6.0-3.4.18/api/pen.zig | 39 + castholm/v0.6.0-3.4.18/api/pixels.zig | 311 ++ castholm/v0.6.0-3.4.18/api/power.zig | 14 + castholm/v0.6.0-3.4.18/api/process.zig | 52 + castholm/v0.6.0-3.4.18/api/properties.zig | 100 + castholm/v0.6.0-3.4.18/api/rect.zig | 65 + castholm/v0.6.0-3.4.18/api/render.zig | 554 +++ castholm/v0.6.0-3.4.18/api/scancode.zig | 254 ++ castholm/v0.6.0-3.4.18/api/sensor.zig | 77 + castholm/v0.6.0-3.4.18/api/stdinc.zig | 3 + castholm/v0.6.0-3.4.18/api/storage.zig | 97 + castholm/v0.6.0-3.4.18/api/surface.zig | 305 ++ castholm/v0.6.0-3.4.18/api/system.zig | 160 + castholm/v0.6.0-3.4.18/api/time.zig | 64 + castholm/v0.6.0-3.4.18/api/timer.zig | 47 + castholm/v0.6.0-3.4.18/api/touch.zig | 35 + castholm/v0.6.0-3.4.18/api/tray.zig | 116 + castholm/v0.6.0-3.4.18/api/version.zig | 9 + castholm/v0.6.0-3.4.18/api/video.zig | 623 +++ castholm/v0.6.0-3.4.18/json/audio.json | 918 ++++ castholm/v0.6.0-3.4.18/json/blendmode.json | 134 + castholm/v0.6.0-3.4.18/json/camera.json | 248 ++ castholm/v0.6.0-3.4.18/json/clipboard.json | 125 + castholm/v0.6.0-3.4.18/json/dialog.json | 158 + castholm/v0.6.0-3.4.18/json/endian.json | 12 + castholm/v0.6.0-3.4.18/json/error.json | 28 + castholm/v0.6.0-3.4.18/json/events.json | 2559 +++++++++++ castholm/v0.6.0-3.4.18/json/filesystem.json | 287 ++ castholm/v0.6.0-3.4.18/json/gamepad.json | 1172 +++++ castholm/v0.6.0-3.4.18/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.6.0-3.4.18/json/guid.json | 51 + castholm/v0.6.0-3.4.18/json/haptic.json | 806 ++++ castholm/v0.6.0-3.4.18/json/hints.json | 139 + castholm/v0.6.0-3.4.18/json/init.json | 202 + castholm/v0.6.0-3.4.18/json/iostream.json | 737 ++++ castholm/v0.6.0-3.4.18/json/joystick.json | 973 +++++ castholm/v0.6.0-3.4.18/json/keyboard.json | 332 ++ castholm/v0.6.0-3.4.18/json/keycode.json | 21 + castholm/v0.6.0-3.4.18/json/loadso.json | 51 + castholm/v0.6.0-3.4.18/json/messagebox.json | 205 + castholm/v0.6.0-3.4.18/json/misc.json | 23 + castholm/v0.6.0-3.4.18/json/mouse.json | 440 ++ castholm/v0.6.0-3.4.18/json/opengl.json | 12 + castholm/v0.6.0-3.4.18/json/pen.json | 135 + castholm/v0.6.0-3.4.18/json/pixels.json | 1214 ++++++ castholm/v0.6.0-3.4.18/json/power.json | 58 + castholm/v0.6.0-3.4.18/json/process.json | 153 + castholm/v0.6.0-3.4.18/json/properties.json | 369 ++ castholm/v0.6.0-3.4.18/json/rect.json | 278 ++ castholm/v0.6.0-3.4.18/json/render.json | 1930 +++++++++ castholm/v0.6.0-3.4.18/json/scancode.json | 1088 +++++ castholm/v0.6.0-3.4.18/json/sensor.json | 207 + castholm/v0.6.0-3.4.18/json/storage.json | 349 ++ castholm/v0.6.0-3.4.18/json/surface.json | 1326 ++++++ castholm/v0.6.0-3.4.18/json/system.json | 359 ++ castholm/v0.6.0-3.4.18/json/time.json | 238 ++ castholm/v0.6.0-3.4.18/json/timer.json | 121 + castholm/v0.6.0-3.4.18/json/touch.json | 114 + castholm/v0.6.0-3.4.18/json/tray.json | 332 ++ castholm/v0.6.0-3.4.18/json/version.json | 23 + castholm/v0.6.0-3.4.18/json/video.json | 1894 +++++++++ castholm/v0.6.1-3.4.20/api/audio.zig | 271 ++ castholm/v0.6.1-3.4.20/api/blendmode.zig | 28 + castholm/v0.6.1-3.4.20/api/c.zig | 1 + castholm/v0.6.1-3.4.20/api/camera.zig | 95 + castholm/v0.6.1-3.4.20/api/clipboard.zig | 49 + castholm/v0.6.1-3.4.20/api/dialog.zig | 36 + castholm/v0.6.1-3.4.20/api/endian.zig | 2 + castholm/v0.6.1-3.4.20/api/error.zig | 18 + castholm/v0.6.1-3.4.20/api/events.zig | 694 +++ castholm/v0.6.1-3.4.20/api/filesystem.zig | 95 + castholm/v0.6.1-3.4.20/api/gamepad.zig | 391 ++ castholm/v0.6.1-3.4.20/api/gpu.zig | 1123 +++++ castholm/v0.6.1-3.4.20/api/guid.zig | 13 + castholm/v0.6.1-3.4.20/api/haptic.zig | 239 ++ castholm/v0.6.1-3.4.20/api/hints.zig | 41 + castholm/v0.6.1-3.4.20/api/init.zig | 75 + castholm/v0.6.1-3.4.20/api/iostream.zig | 221 + castholm/v0.6.1-3.4.20/api/joystick.zig | 307 ++ castholm/v0.6.1-3.4.20/api/keyboard.zig | 131 + castholm/v0.6.1-3.4.20/api/keycode.zig | 5 + castholm/v0.6.1-3.4.20/api/loadso.zig | 19 + castholm/v0.6.1-3.4.20/api/messagebox.zig | 70 + castholm/v0.6.1-3.4.20/api/misc.zig | 5 + castholm/v0.6.1-3.4.20/api/mouse.zig | 155 + castholm/v0.6.1-3.4.20/api/opengl.zig | 2 + castholm/v0.6.1-3.4.20/api/pen.zig | 39 + castholm/v0.6.1-3.4.20/api/pixels.zig | 311 ++ castholm/v0.6.1-3.4.20/api/power.zig | 14 + castholm/v0.6.1-3.4.20/api/process.zig | 52 + castholm/v0.6.1-3.4.20/api/properties.zig | 100 + castholm/v0.6.1-3.4.20/api/rect.zig | 65 + castholm/v0.6.1-3.4.20/api/render.zig | 554 +++ castholm/v0.6.1-3.4.20/api/scancode.zig | 254 ++ castholm/v0.6.1-3.4.20/api/sensor.zig | 77 + castholm/v0.6.1-3.4.20/api/stdinc.zig | 3 + castholm/v0.6.1-3.4.20/api/storage.zig | 97 + castholm/v0.6.1-3.4.20/api/surface.zig | 305 ++ castholm/v0.6.1-3.4.20/api/system.zig | 160 + castholm/v0.6.1-3.4.20/api/time.zig | 64 + castholm/v0.6.1-3.4.20/api/timer.zig | 47 + castholm/v0.6.1-3.4.20/api/touch.zig | 35 + castholm/v0.6.1-3.4.20/api/tray.zig | 116 + castholm/v0.6.1-3.4.20/api/version.zig | 9 + castholm/v0.6.1-3.4.20/api/video.zig | 623 +++ castholm/v0.6.1-3.4.20/json/audio.json | 918 ++++ castholm/v0.6.1-3.4.20/json/blendmode.json | 134 + castholm/v0.6.1-3.4.20/json/camera.json | 248 ++ castholm/v0.6.1-3.4.20/json/clipboard.json | 125 + castholm/v0.6.1-3.4.20/json/dialog.json | 158 + castholm/v0.6.1-3.4.20/json/endian.json | 12 + castholm/v0.6.1-3.4.20/json/error.json | 28 + castholm/v0.6.1-3.4.20/json/events.json | 2559 +++++++++++ castholm/v0.6.1-3.4.20/json/filesystem.json | 287 ++ castholm/v0.6.1-3.4.20/json/gamepad.json | 1172 +++++ castholm/v0.6.1-3.4.20/json/gpu.json | 3988 ++++++++++++++++++ castholm/v0.6.1-3.4.20/json/guid.json | 51 + castholm/v0.6.1-3.4.20/json/haptic.json | 806 ++++ castholm/v0.6.1-3.4.20/json/hints.json | 139 + castholm/v0.6.1-3.4.20/json/init.json | 202 + castholm/v0.6.1-3.4.20/json/iostream.json | 737 ++++ castholm/v0.6.1-3.4.20/json/joystick.json | 973 +++++ castholm/v0.6.1-3.4.20/json/keyboard.json | 332 ++ castholm/v0.6.1-3.4.20/json/keycode.json | 21 + castholm/v0.6.1-3.4.20/json/loadso.json | 51 + castholm/v0.6.1-3.4.20/json/messagebox.json | 205 + castholm/v0.6.1-3.4.20/json/misc.json | 23 + castholm/v0.6.1-3.4.20/json/mouse.json | 440 ++ castholm/v0.6.1-3.4.20/json/opengl.json | 12 + castholm/v0.6.1-3.4.20/json/pen.json | 135 + castholm/v0.6.1-3.4.20/json/pixels.json | 1214 ++++++ castholm/v0.6.1-3.4.20/json/power.json | 58 + castholm/v0.6.1-3.4.20/json/process.json | 153 + castholm/v0.6.1-3.4.20/json/properties.json | 369 ++ castholm/v0.6.1-3.4.20/json/rect.json | 278 ++ castholm/v0.6.1-3.4.20/json/render.json | 1930 +++++++++ castholm/v0.6.1-3.4.20/json/scancode.json | 1088 +++++ castholm/v0.6.1-3.4.20/json/sensor.json | 207 + castholm/v0.6.1-3.4.20/json/storage.json | 349 ++ castholm/v0.6.1-3.4.20/json/surface.json | 1326 ++++++ castholm/v0.6.1-3.4.20/json/system.json | 359 ++ castholm/v0.6.1-3.4.20/json/time.json | 238 ++ castholm/v0.6.1-3.4.20/json/timer.json | 121 + castholm/v0.6.1-3.4.20/json/touch.json | 114 + castholm/v0.6.1-3.4.20/json/tray.json | 332 ++ castholm/v0.6.1-3.4.20/json/version.json | 23 + castholm/v0.6.1-3.4.20/json/video.json | 1894 +++++++++ official/release-3.4.10/api/audio.zig | 271 ++ official/release-3.4.10/api/blendmode.zig | 28 + official/release-3.4.10/api/c.zig | 1 + official/release-3.4.10/api/camera.zig | 95 + official/release-3.4.10/api/clipboard.zig | 49 + official/release-3.4.10/api/dialog.zig | 36 + official/release-3.4.10/api/endian.zig | 2 + official/release-3.4.10/api/error.zig | 18 + official/release-3.4.10/api/events.zig | 687 +++ official/release-3.4.10/api/filesystem.zig | 95 + official/release-3.4.10/api/gamepad.zig | 390 ++ official/release-3.4.10/api/gpu.zig | 1123 +++++ official/release-3.4.10/api/guid.zig | 13 + official/release-3.4.10/api/haptic.zig | 239 ++ official/release-3.4.10/api/hints.zig | 41 + official/release-3.4.10/api/init.zig | 75 + official/release-3.4.10/api/iostream.zig | 221 + official/release-3.4.10/api/joystick.zig | 307 ++ official/release-3.4.10/api/keyboard.zig | 131 + official/release-3.4.10/api/keycode.zig | 5 + official/release-3.4.10/api/loadso.zig | 19 + official/release-3.4.10/api/messagebox.zig | 70 + official/release-3.4.10/api/misc.zig | 5 + official/release-3.4.10/api/mouse.zig | 155 + official/release-3.4.10/api/opengl.zig | 2 + official/release-3.4.10/api/pen.zig | 39 + official/release-3.4.10/api/pixels.zig | 311 ++ official/release-3.4.10/api/power.zig | 14 + official/release-3.4.10/api/process.zig | 52 + official/release-3.4.10/api/properties.zig | 100 + official/release-3.4.10/api/rect.zig | 65 + official/release-3.4.10/api/render.zig | 553 +++ official/release-3.4.10/api/scancode.zig | 253 ++ official/release-3.4.10/api/sensor.zig | 77 + official/release-3.4.10/api/stdinc.zig | 3 + official/release-3.4.10/api/storage.zig | 97 + official/release-3.4.10/api/surface.zig | 305 ++ official/release-3.4.10/api/system.zig | 160 + official/release-3.4.10/api/time.zig | 64 + official/release-3.4.10/api/timer.zig | 47 + official/release-3.4.10/api/touch.zig | 35 + official/release-3.4.10/api/tray.zig | 116 + official/release-3.4.10/api/version.zig | 9 + official/release-3.4.10/api/video.zig | 623 +++ official/release-3.4.10/json/audio.json | 918 ++++ official/release-3.4.10/json/blendmode.json | 134 + official/release-3.4.10/json/camera.json | 248 ++ official/release-3.4.10/json/clipboard.json | 125 + official/release-3.4.10/json/dialog.json | 158 + official/release-3.4.10/json/endian.json | 12 + official/release-3.4.10/json/error.json | 28 + official/release-3.4.10/json/events.json | 2529 +++++++++++ official/release-3.4.10/json/filesystem.json | 287 ++ official/release-3.4.10/json/gamepad.json | 1169 +++++ official/release-3.4.10/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.10/json/guid.json | 51 + official/release-3.4.10/json/haptic.json | 806 ++++ official/release-3.4.10/json/hints.json | 139 + official/release-3.4.10/json/init.json | 202 + official/release-3.4.10/json/iostream.json | 737 ++++ official/release-3.4.10/json/joystick.json | 973 +++++ official/release-3.4.10/json/keyboard.json | 332 ++ official/release-3.4.10/json/keycode.json | 21 + official/release-3.4.10/json/loadso.json | 51 + official/release-3.4.10/json/messagebox.json | 205 + official/release-3.4.10/json/misc.json | 23 + official/release-3.4.10/json/mouse.json | 440 ++ official/release-3.4.10/json/opengl.json | 12 + official/release-3.4.10/json/pen.json | 135 + official/release-3.4.10/json/pixels.json | 1214 ++++++ official/release-3.4.10/json/power.json | 58 + official/release-3.4.10/json/process.json | 153 + official/release-3.4.10/json/properties.json | 369 ++ official/release-3.4.10/json/rect.json | 278 ++ official/release-3.4.10/json/render.json | 1930 +++++++++ official/release-3.4.10/json/scancode.json | 1083 +++++ official/release-3.4.10/json/sensor.json | 207 + official/release-3.4.10/json/storage.json | 349 ++ official/release-3.4.10/json/surface.json | 1326 ++++++ official/release-3.4.10/json/system.json | 359 ++ official/release-3.4.10/json/time.json | 238 ++ official/release-3.4.10/json/timer.json | 121 + official/release-3.4.10/json/touch.json | 114 + official/release-3.4.10/json/tray.json | 332 ++ official/release-3.4.10/json/version.json | 23 + official/release-3.4.10/json/video.json | 1894 +++++++++ official/release-3.4.12/api/audio.zig | 271 ++ official/release-3.4.12/api/blendmode.zig | 28 + official/release-3.4.12/api/c.zig | 1 + official/release-3.4.12/api/camera.zig | 95 + official/release-3.4.12/api/clipboard.zig | 49 + official/release-3.4.12/api/dialog.zig | 36 + official/release-3.4.12/api/endian.zig | 2 + official/release-3.4.12/api/error.zig | 18 + official/release-3.4.12/api/events.zig | 687 +++ official/release-3.4.12/api/filesystem.zig | 95 + official/release-3.4.12/api/gamepad.zig | 390 ++ official/release-3.4.12/api/gpu.zig | 1123 +++++ official/release-3.4.12/api/guid.zig | 13 + official/release-3.4.12/api/haptic.zig | 239 ++ official/release-3.4.12/api/hints.zig | 41 + official/release-3.4.12/api/init.zig | 75 + official/release-3.4.12/api/iostream.zig | 221 + official/release-3.4.12/api/joystick.zig | 307 ++ official/release-3.4.12/api/keyboard.zig | 131 + official/release-3.4.12/api/keycode.zig | 5 + official/release-3.4.12/api/loadso.zig | 19 + official/release-3.4.12/api/messagebox.zig | 70 + official/release-3.4.12/api/misc.zig | 5 + official/release-3.4.12/api/mouse.zig | 155 + official/release-3.4.12/api/opengl.zig | 2 + official/release-3.4.12/api/pen.zig | 39 + official/release-3.4.12/api/pixels.zig | 311 ++ official/release-3.4.12/api/power.zig | 14 + official/release-3.4.12/api/process.zig | 52 + official/release-3.4.12/api/properties.zig | 100 + official/release-3.4.12/api/rect.zig | 65 + official/release-3.4.12/api/render.zig | 553 +++ official/release-3.4.12/api/scancode.zig | 253 ++ official/release-3.4.12/api/sensor.zig | 77 + official/release-3.4.12/api/stdinc.zig | 3 + official/release-3.4.12/api/storage.zig | 97 + official/release-3.4.12/api/surface.zig | 305 ++ official/release-3.4.12/api/system.zig | 160 + official/release-3.4.12/api/time.zig | 64 + official/release-3.4.12/api/timer.zig | 47 + official/release-3.4.12/api/touch.zig | 35 + official/release-3.4.12/api/tray.zig | 116 + official/release-3.4.12/api/version.zig | 9 + official/release-3.4.12/api/video.zig | 623 +++ official/release-3.4.12/json/audio.json | 918 ++++ official/release-3.4.12/json/blendmode.json | 134 + official/release-3.4.12/json/camera.json | 248 ++ official/release-3.4.12/json/clipboard.json | 125 + official/release-3.4.12/json/dialog.json | 158 + official/release-3.4.12/json/endian.json | 12 + official/release-3.4.12/json/error.json | 28 + official/release-3.4.12/json/events.json | 2529 +++++++++++ official/release-3.4.12/json/filesystem.json | 287 ++ official/release-3.4.12/json/gamepad.json | 1169 +++++ official/release-3.4.12/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.12/json/guid.json | 51 + official/release-3.4.12/json/haptic.json | 806 ++++ official/release-3.4.12/json/hints.json | 139 + official/release-3.4.12/json/init.json | 202 + official/release-3.4.12/json/iostream.json | 737 ++++ official/release-3.4.12/json/joystick.json | 973 +++++ official/release-3.4.12/json/keyboard.json | 332 ++ official/release-3.4.12/json/keycode.json | 21 + official/release-3.4.12/json/loadso.json | 51 + official/release-3.4.12/json/messagebox.json | 205 + official/release-3.4.12/json/misc.json | 23 + official/release-3.4.12/json/mouse.json | 440 ++ official/release-3.4.12/json/opengl.json | 12 + official/release-3.4.12/json/pen.json | 135 + official/release-3.4.12/json/pixels.json | 1214 ++++++ official/release-3.4.12/json/power.json | 58 + official/release-3.4.12/json/process.json | 153 + official/release-3.4.12/json/properties.json | 369 ++ official/release-3.4.12/json/rect.json | 278 ++ official/release-3.4.12/json/render.json | 1930 +++++++++ official/release-3.4.12/json/scancode.json | 1083 +++++ official/release-3.4.12/json/sensor.json | 207 + official/release-3.4.12/json/storage.json | 349 ++ official/release-3.4.12/json/surface.json | 1326 ++++++ official/release-3.4.12/json/system.json | 359 ++ official/release-3.4.12/json/time.json | 238 ++ official/release-3.4.12/json/timer.json | 121 + official/release-3.4.12/json/touch.json | 114 + official/release-3.4.12/json/tray.json | 332 ++ official/release-3.4.12/json/version.json | 23 + official/release-3.4.12/json/video.json | 1894 +++++++++ official/release-3.4.14/api/audio.zig | 271 ++ official/release-3.4.14/api/blendmode.zig | 28 + official/release-3.4.14/api/c.zig | 1 + official/release-3.4.14/api/camera.zig | 95 + official/release-3.4.14/api/clipboard.zig | 49 + official/release-3.4.14/api/dialog.zig | 36 + official/release-3.4.14/api/endian.zig | 2 + official/release-3.4.14/api/error.zig | 18 + official/release-3.4.14/api/events.zig | 687 +++ official/release-3.4.14/api/filesystem.zig | 95 + official/release-3.4.14/api/gamepad.zig | 390 ++ official/release-3.4.14/api/gpu.zig | 1123 +++++ official/release-3.4.14/api/guid.zig | 13 + official/release-3.4.14/api/haptic.zig | 239 ++ official/release-3.4.14/api/hints.zig | 41 + official/release-3.4.14/api/init.zig | 75 + official/release-3.4.14/api/iostream.zig | 221 + official/release-3.4.14/api/joystick.zig | 307 ++ official/release-3.4.14/api/keyboard.zig | 131 + official/release-3.4.14/api/keycode.zig | 5 + official/release-3.4.14/api/loadso.zig | 19 + official/release-3.4.14/api/messagebox.zig | 70 + official/release-3.4.14/api/misc.zig | 5 + official/release-3.4.14/api/mouse.zig | 155 + official/release-3.4.14/api/opengl.zig | 2 + official/release-3.4.14/api/pen.zig | 39 + official/release-3.4.14/api/pixels.zig | 311 ++ official/release-3.4.14/api/power.zig | 14 + official/release-3.4.14/api/process.zig | 52 + official/release-3.4.14/api/properties.zig | 100 + official/release-3.4.14/api/rect.zig | 65 + official/release-3.4.14/api/render.zig | 553 +++ official/release-3.4.14/api/scancode.zig | 253 ++ official/release-3.4.14/api/sensor.zig | 77 + official/release-3.4.14/api/stdinc.zig | 3 + official/release-3.4.14/api/storage.zig | 97 + official/release-3.4.14/api/surface.zig | 305 ++ official/release-3.4.14/api/system.zig | 160 + official/release-3.4.14/api/time.zig | 64 + official/release-3.4.14/api/timer.zig | 47 + official/release-3.4.14/api/touch.zig | 35 + official/release-3.4.14/api/tray.zig | 116 + official/release-3.4.14/api/version.zig | 9 + official/release-3.4.14/api/video.zig | 623 +++ official/release-3.4.14/json/audio.json | 918 ++++ official/release-3.4.14/json/blendmode.json | 134 + official/release-3.4.14/json/camera.json | 248 ++ official/release-3.4.14/json/clipboard.json | 125 + official/release-3.4.14/json/dialog.json | 158 + official/release-3.4.14/json/endian.json | 12 + official/release-3.4.14/json/error.json | 28 + official/release-3.4.14/json/events.json | 2529 +++++++++++ official/release-3.4.14/json/filesystem.json | 287 ++ official/release-3.4.14/json/gamepad.json | 1169 +++++ official/release-3.4.14/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.14/json/guid.json | 51 + official/release-3.4.14/json/haptic.json | 806 ++++ official/release-3.4.14/json/hints.json | 139 + official/release-3.4.14/json/init.json | 202 + official/release-3.4.14/json/iostream.json | 737 ++++ official/release-3.4.14/json/joystick.json | 973 +++++ official/release-3.4.14/json/keyboard.json | 332 ++ official/release-3.4.14/json/keycode.json | 21 + official/release-3.4.14/json/loadso.json | 51 + official/release-3.4.14/json/messagebox.json | 205 + official/release-3.4.14/json/misc.json | 23 + official/release-3.4.14/json/mouse.json | 440 ++ official/release-3.4.14/json/opengl.json | 12 + official/release-3.4.14/json/pen.json | 135 + official/release-3.4.14/json/pixels.json | 1214 ++++++ official/release-3.4.14/json/power.json | 58 + official/release-3.4.14/json/process.json | 153 + official/release-3.4.14/json/properties.json | 369 ++ official/release-3.4.14/json/rect.json | 278 ++ official/release-3.4.14/json/render.json | 1930 +++++++++ official/release-3.4.14/json/scancode.json | 1083 +++++ official/release-3.4.14/json/sensor.json | 207 + official/release-3.4.14/json/storage.json | 349 ++ official/release-3.4.14/json/surface.json | 1326 ++++++ official/release-3.4.14/json/system.json | 359 ++ official/release-3.4.14/json/time.json | 238 ++ official/release-3.4.14/json/timer.json | 121 + official/release-3.4.14/json/touch.json | 114 + official/release-3.4.14/json/tray.json | 332 ++ official/release-3.4.14/json/version.json | 23 + official/release-3.4.14/json/video.json | 1894 +++++++++ official/release-3.4.16/api/audio.zig | 271 ++ official/release-3.4.16/api/blendmode.zig | 28 + official/release-3.4.16/api/c.zig | 1 + official/release-3.4.16/api/camera.zig | 95 + official/release-3.4.16/api/clipboard.zig | 49 + official/release-3.4.16/api/dialog.zig | 36 + official/release-3.4.16/api/endian.zig | 2 + official/release-3.4.16/api/error.zig | 18 + official/release-3.4.16/api/events.zig | 688 +++ official/release-3.4.16/api/filesystem.zig | 95 + official/release-3.4.16/api/gamepad.zig | 390 ++ official/release-3.4.16/api/gpu.zig | 1123 +++++ official/release-3.4.16/api/guid.zig | 13 + official/release-3.4.16/api/haptic.zig | 239 ++ official/release-3.4.16/api/hints.zig | 41 + official/release-3.4.16/api/init.zig | 75 + official/release-3.4.16/api/iostream.zig | 221 + official/release-3.4.16/api/joystick.zig | 307 ++ official/release-3.4.16/api/keyboard.zig | 131 + official/release-3.4.16/api/keycode.zig | 5 + official/release-3.4.16/api/loadso.zig | 19 + official/release-3.4.16/api/messagebox.zig | 70 + official/release-3.4.16/api/misc.zig | 5 + official/release-3.4.16/api/mouse.zig | 155 + official/release-3.4.16/api/opengl.zig | 2 + official/release-3.4.16/api/pen.zig | 39 + official/release-3.4.16/api/pixels.zig | 311 ++ official/release-3.4.16/api/power.zig | 14 + official/release-3.4.16/api/process.zig | 52 + official/release-3.4.16/api/properties.zig | 100 + official/release-3.4.16/api/rect.zig | 65 + official/release-3.4.16/api/render.zig | 553 +++ official/release-3.4.16/api/scancode.zig | 253 ++ official/release-3.4.16/api/sensor.zig | 77 + official/release-3.4.16/api/stdinc.zig | 3 + official/release-3.4.16/api/storage.zig | 97 + official/release-3.4.16/api/surface.zig | 305 ++ official/release-3.4.16/api/system.zig | 160 + official/release-3.4.16/api/time.zig | 64 + official/release-3.4.16/api/timer.zig | 47 + official/release-3.4.16/api/touch.zig | 35 + official/release-3.4.16/api/tray.zig | 116 + official/release-3.4.16/api/version.zig | 9 + official/release-3.4.16/api/video.zig | 623 +++ official/release-3.4.16/json/audio.json | 918 ++++ official/release-3.4.16/json/blendmode.json | 134 + official/release-3.4.16/json/camera.json | 248 ++ official/release-3.4.16/json/clipboard.json | 125 + official/release-3.4.16/json/dialog.json | 158 + official/release-3.4.16/json/endian.json | 12 + official/release-3.4.16/json/error.json | 28 + official/release-3.4.16/json/events.json | 2534 +++++++++++ official/release-3.4.16/json/filesystem.json | 287 ++ official/release-3.4.16/json/gamepad.json | 1169 +++++ official/release-3.4.16/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.16/json/guid.json | 51 + official/release-3.4.16/json/haptic.json | 806 ++++ official/release-3.4.16/json/hints.json | 139 + official/release-3.4.16/json/init.json | 202 + official/release-3.4.16/json/iostream.json | 737 ++++ official/release-3.4.16/json/joystick.json | 973 +++++ official/release-3.4.16/json/keyboard.json | 332 ++ official/release-3.4.16/json/keycode.json | 21 + official/release-3.4.16/json/loadso.json | 51 + official/release-3.4.16/json/messagebox.json | 205 + official/release-3.4.16/json/misc.json | 23 + official/release-3.4.16/json/mouse.json | 440 ++ official/release-3.4.16/json/opengl.json | 12 + official/release-3.4.16/json/pen.json | 135 + official/release-3.4.16/json/pixels.json | 1214 ++++++ official/release-3.4.16/json/power.json | 58 + official/release-3.4.16/json/process.json | 153 + official/release-3.4.16/json/properties.json | 369 ++ official/release-3.4.16/json/rect.json | 278 ++ official/release-3.4.16/json/render.json | 1930 +++++++++ official/release-3.4.16/json/scancode.json | 1083 +++++ official/release-3.4.16/json/sensor.json | 207 + official/release-3.4.16/json/storage.json | 349 ++ official/release-3.4.16/json/surface.json | 1326 ++++++ official/release-3.4.16/json/system.json | 359 ++ official/release-3.4.16/json/time.json | 238 ++ official/release-3.4.16/json/timer.json | 121 + official/release-3.4.16/json/touch.json | 114 + official/release-3.4.16/json/tray.json | 332 ++ official/release-3.4.16/json/version.json | 23 + official/release-3.4.16/json/video.json | 1894 +++++++++ official/release-3.4.18/api/audio.zig | 271 ++ official/release-3.4.18/api/blendmode.zig | 28 + official/release-3.4.18/api/c.zig | 1 + official/release-3.4.18/api/camera.zig | 95 + official/release-3.4.18/api/clipboard.zig | 49 + official/release-3.4.18/api/dialog.zig | 36 + official/release-3.4.18/api/endian.zig | 2 + official/release-3.4.18/api/error.zig | 18 + official/release-3.4.18/api/events.zig | 694 +++ official/release-3.4.18/api/filesystem.zig | 95 + official/release-3.4.18/api/gamepad.zig | 391 ++ official/release-3.4.18/api/gpu.zig | 1123 +++++ official/release-3.4.18/api/guid.zig | 13 + official/release-3.4.18/api/haptic.zig | 239 ++ official/release-3.4.18/api/hints.zig | 41 + official/release-3.4.18/api/init.zig | 75 + official/release-3.4.18/api/iostream.zig | 221 + official/release-3.4.18/api/joystick.zig | 307 ++ official/release-3.4.18/api/keyboard.zig | 131 + official/release-3.4.18/api/keycode.zig | 5 + official/release-3.4.18/api/loadso.zig | 19 + official/release-3.4.18/api/messagebox.zig | 70 + official/release-3.4.18/api/misc.zig | 5 + official/release-3.4.18/api/mouse.zig | 155 + official/release-3.4.18/api/opengl.zig | 2 + official/release-3.4.18/api/pen.zig | 39 + official/release-3.4.18/api/pixels.zig | 311 ++ official/release-3.4.18/api/power.zig | 14 + official/release-3.4.18/api/process.zig | 52 + official/release-3.4.18/api/properties.zig | 100 + official/release-3.4.18/api/rect.zig | 65 + official/release-3.4.18/api/render.zig | 554 +++ official/release-3.4.18/api/scancode.zig | 254 ++ official/release-3.4.18/api/sensor.zig | 77 + official/release-3.4.18/api/stdinc.zig | 3 + official/release-3.4.18/api/storage.zig | 97 + official/release-3.4.18/api/surface.zig | 305 ++ official/release-3.4.18/api/system.zig | 160 + official/release-3.4.18/api/time.zig | 64 + official/release-3.4.18/api/timer.zig | 47 + official/release-3.4.18/api/touch.zig | 35 + official/release-3.4.18/api/tray.zig | 116 + official/release-3.4.18/api/version.zig | 9 + official/release-3.4.18/api/video.zig | 623 +++ official/release-3.4.18/json/audio.json | 918 ++++ official/release-3.4.18/json/blendmode.json | 134 + official/release-3.4.18/json/camera.json | 248 ++ official/release-3.4.18/json/clipboard.json | 125 + official/release-3.4.18/json/dialog.json | 158 + official/release-3.4.18/json/endian.json | 12 + official/release-3.4.18/json/error.json | 28 + official/release-3.4.18/json/events.json | 2559 +++++++++++ official/release-3.4.18/json/filesystem.json | 287 ++ official/release-3.4.18/json/gamepad.json | 1172 +++++ official/release-3.4.18/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.18/json/guid.json | 51 + official/release-3.4.18/json/haptic.json | 806 ++++ official/release-3.4.18/json/hints.json | 139 + official/release-3.4.18/json/init.json | 202 + official/release-3.4.18/json/iostream.json | 737 ++++ official/release-3.4.18/json/joystick.json | 973 +++++ official/release-3.4.18/json/keyboard.json | 332 ++ official/release-3.4.18/json/keycode.json | 21 + official/release-3.4.18/json/loadso.json | 51 + official/release-3.4.18/json/messagebox.json | 205 + official/release-3.4.18/json/misc.json | 23 + official/release-3.4.18/json/mouse.json | 440 ++ official/release-3.4.18/json/opengl.json | 12 + official/release-3.4.18/json/pen.json | 135 + official/release-3.4.18/json/pixels.json | 1214 ++++++ official/release-3.4.18/json/power.json | 58 + official/release-3.4.18/json/process.json | 153 + official/release-3.4.18/json/properties.json | 369 ++ official/release-3.4.18/json/rect.json | 278 ++ official/release-3.4.18/json/render.json | 1930 +++++++++ official/release-3.4.18/json/scancode.json | 1088 +++++ official/release-3.4.18/json/sensor.json | 207 + official/release-3.4.18/json/storage.json | 349 ++ official/release-3.4.18/json/surface.json | 1326 ++++++ official/release-3.4.18/json/system.json | 359 ++ official/release-3.4.18/json/time.json | 238 ++ official/release-3.4.18/json/timer.json | 121 + official/release-3.4.18/json/touch.json | 114 + official/release-3.4.18/json/tray.json | 332 ++ official/release-3.4.18/json/version.json | 23 + official/release-3.4.18/json/video.json | 1894 +++++++++ official/release-3.4.2/api/audio.zig | 271 ++ official/release-3.4.2/api/blendmode.zig | 28 + official/release-3.4.2/api/c.zig | 1 + official/release-3.4.2/api/camera.zig | 95 + official/release-3.4.2/api/clipboard.zig | 49 + official/release-3.4.2/api/dialog.zig | 36 + official/release-3.4.2/api/endian.zig | 2 + official/release-3.4.2/api/error.zig | 18 + official/release-3.4.2/api/events.zig | 687 +++ official/release-3.4.2/api/filesystem.zig | 95 + official/release-3.4.2/api/gamepad.zig | 390 ++ official/release-3.4.2/api/gpu.zig | 1123 +++++ official/release-3.4.2/api/guid.zig | 13 + official/release-3.4.2/api/haptic.zig | 239 ++ official/release-3.4.2/api/hints.zig | 41 + official/release-3.4.2/api/init.zig | 75 + official/release-3.4.2/api/iostream.zig | 221 + official/release-3.4.2/api/joystick.zig | 307 ++ official/release-3.4.2/api/keyboard.zig | 131 + official/release-3.4.2/api/keycode.zig | 5 + official/release-3.4.2/api/loadso.zig | 19 + official/release-3.4.2/api/messagebox.zig | 70 + official/release-3.4.2/api/misc.zig | 5 + official/release-3.4.2/api/mouse.zig | 155 + official/release-3.4.2/api/opengl.zig | 2 + official/release-3.4.2/api/pen.zig | 39 + official/release-3.4.2/api/pixels.zig | 311 ++ official/release-3.4.2/api/power.zig | 14 + official/release-3.4.2/api/process.zig | 52 + official/release-3.4.2/api/properties.zig | 100 + official/release-3.4.2/api/rect.zig | 65 + official/release-3.4.2/api/render.zig | 553 +++ official/release-3.4.2/api/scancode.zig | 253 ++ official/release-3.4.2/api/sensor.zig | 77 + official/release-3.4.2/api/stdinc.zig | 3 + official/release-3.4.2/api/storage.zig | 97 + official/release-3.4.2/api/surface.zig | 305 ++ official/release-3.4.2/api/system.zig | 160 + official/release-3.4.2/api/time.zig | 64 + official/release-3.4.2/api/timer.zig | 47 + official/release-3.4.2/api/touch.zig | 35 + official/release-3.4.2/api/tray.zig | 116 + official/release-3.4.2/api/version.zig | 9 + official/release-3.4.2/api/video.zig | 623 +++ official/release-3.4.2/json/audio.json | 918 ++++ official/release-3.4.2/json/blendmode.json | 134 + official/release-3.4.2/json/camera.json | 248 ++ official/release-3.4.2/json/clipboard.json | 125 + official/release-3.4.2/json/dialog.json | 158 + official/release-3.4.2/json/endian.json | 12 + official/release-3.4.2/json/error.json | 28 + official/release-3.4.2/json/events.json | 2529 +++++++++++ official/release-3.4.2/json/filesystem.json | 287 ++ official/release-3.4.2/json/gamepad.json | 1169 +++++ official/release-3.4.2/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.2/json/guid.json | 51 + official/release-3.4.2/json/haptic.json | 806 ++++ official/release-3.4.2/json/hints.json | 139 + official/release-3.4.2/json/init.json | 202 + official/release-3.4.2/json/iostream.json | 737 ++++ official/release-3.4.2/json/joystick.json | 973 +++++ official/release-3.4.2/json/keyboard.json | 332 ++ official/release-3.4.2/json/keycode.json | 21 + official/release-3.4.2/json/loadso.json | 51 + official/release-3.4.2/json/messagebox.json | 205 + official/release-3.4.2/json/misc.json | 23 + official/release-3.4.2/json/mouse.json | 440 ++ official/release-3.4.2/json/opengl.json | 12 + official/release-3.4.2/json/pen.json | 135 + official/release-3.4.2/json/pixels.json | 1214 ++++++ official/release-3.4.2/json/power.json | 58 + official/release-3.4.2/json/process.json | 153 + official/release-3.4.2/json/properties.json | 369 ++ official/release-3.4.2/json/rect.json | 278 ++ official/release-3.4.2/json/render.json | 1930 +++++++++ official/release-3.4.2/json/scancode.json | 1083 +++++ official/release-3.4.2/json/sensor.json | 207 + official/release-3.4.2/json/storage.json | 349 ++ official/release-3.4.2/json/surface.json | 1326 ++++++ official/release-3.4.2/json/system.json | 359 ++ official/release-3.4.2/json/time.json | 238 ++ official/release-3.4.2/json/timer.json | 121 + official/release-3.4.2/json/touch.json | 114 + official/release-3.4.2/json/tray.json | 332 ++ official/release-3.4.2/json/version.json | 23 + official/release-3.4.2/json/video.json | 1894 +++++++++ official/release-3.4.20/api/audio.zig | 271 ++ official/release-3.4.20/api/blendmode.zig | 28 + official/release-3.4.20/api/c.zig | 1 + official/release-3.4.20/api/camera.zig | 95 + official/release-3.4.20/api/clipboard.zig | 49 + official/release-3.4.20/api/dialog.zig | 36 + official/release-3.4.20/api/endian.zig | 2 + official/release-3.4.20/api/error.zig | 18 + official/release-3.4.20/api/events.zig | 694 +++ official/release-3.4.20/api/filesystem.zig | 95 + official/release-3.4.20/api/gamepad.zig | 391 ++ official/release-3.4.20/api/gpu.zig | 1123 +++++ official/release-3.4.20/api/guid.zig | 13 + official/release-3.4.20/api/haptic.zig | 239 ++ official/release-3.4.20/api/hints.zig | 41 + official/release-3.4.20/api/init.zig | 75 + official/release-3.4.20/api/iostream.zig | 221 + official/release-3.4.20/api/joystick.zig | 307 ++ official/release-3.4.20/api/keyboard.zig | 131 + official/release-3.4.20/api/keycode.zig | 5 + official/release-3.4.20/api/loadso.zig | 19 + official/release-3.4.20/api/messagebox.zig | 70 + official/release-3.4.20/api/misc.zig | 5 + official/release-3.4.20/api/mouse.zig | 155 + official/release-3.4.20/api/opengl.zig | 2 + official/release-3.4.20/api/pen.zig | 39 + official/release-3.4.20/api/pixels.zig | 311 ++ official/release-3.4.20/api/power.zig | 14 + official/release-3.4.20/api/process.zig | 52 + official/release-3.4.20/api/properties.zig | 100 + official/release-3.4.20/api/rect.zig | 65 + official/release-3.4.20/api/render.zig | 554 +++ official/release-3.4.20/api/scancode.zig | 254 ++ official/release-3.4.20/api/sensor.zig | 77 + official/release-3.4.20/api/stdinc.zig | 3 + official/release-3.4.20/api/storage.zig | 97 + official/release-3.4.20/api/surface.zig | 305 ++ official/release-3.4.20/api/system.zig | 160 + official/release-3.4.20/api/time.zig | 64 + official/release-3.4.20/api/timer.zig | 47 + official/release-3.4.20/api/touch.zig | 35 + official/release-3.4.20/api/tray.zig | 116 + official/release-3.4.20/api/version.zig | 9 + official/release-3.4.20/api/video.zig | 623 +++ official/release-3.4.20/json/audio.json | 918 ++++ official/release-3.4.20/json/blendmode.json | 134 + official/release-3.4.20/json/camera.json | 248 ++ official/release-3.4.20/json/clipboard.json | 125 + official/release-3.4.20/json/dialog.json | 158 + official/release-3.4.20/json/endian.json | 12 + official/release-3.4.20/json/error.json | 28 + official/release-3.4.20/json/events.json | 2559 +++++++++++ official/release-3.4.20/json/filesystem.json | 287 ++ official/release-3.4.20/json/gamepad.json | 1172 +++++ official/release-3.4.20/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.20/json/guid.json | 51 + official/release-3.4.20/json/haptic.json | 806 ++++ official/release-3.4.20/json/hints.json | 139 + official/release-3.4.20/json/init.json | 202 + official/release-3.4.20/json/iostream.json | 737 ++++ official/release-3.4.20/json/joystick.json | 973 +++++ official/release-3.4.20/json/keyboard.json | 332 ++ official/release-3.4.20/json/keycode.json | 21 + official/release-3.4.20/json/loadso.json | 51 + official/release-3.4.20/json/messagebox.json | 205 + official/release-3.4.20/json/misc.json | 23 + official/release-3.4.20/json/mouse.json | 440 ++ official/release-3.4.20/json/opengl.json | 12 + official/release-3.4.20/json/pen.json | 135 + official/release-3.4.20/json/pixels.json | 1214 ++++++ official/release-3.4.20/json/power.json | 58 + official/release-3.4.20/json/process.json | 153 + official/release-3.4.20/json/properties.json | 369 ++ official/release-3.4.20/json/rect.json | 278 ++ official/release-3.4.20/json/render.json | 1930 +++++++++ official/release-3.4.20/json/scancode.json | 1088 +++++ official/release-3.4.20/json/sensor.json | 207 + official/release-3.4.20/json/storage.json | 349 ++ official/release-3.4.20/json/surface.json | 1326 ++++++ official/release-3.4.20/json/system.json | 359 ++ official/release-3.4.20/json/time.json | 238 ++ official/release-3.4.20/json/timer.json | 121 + official/release-3.4.20/json/touch.json | 114 + official/release-3.4.20/json/tray.json | 332 ++ official/release-3.4.20/json/version.json | 23 + official/release-3.4.20/json/video.json | 1894 +++++++++ official/release-3.4.4/api/audio.zig | 271 ++ official/release-3.4.4/api/blendmode.zig | 28 + official/release-3.4.4/api/c.zig | 1 + official/release-3.4.4/api/camera.zig | 95 + official/release-3.4.4/api/clipboard.zig | 49 + official/release-3.4.4/api/dialog.zig | 36 + official/release-3.4.4/api/endian.zig | 2 + official/release-3.4.4/api/error.zig | 18 + official/release-3.4.4/api/events.zig | 687 +++ official/release-3.4.4/api/filesystem.zig | 95 + official/release-3.4.4/api/gamepad.zig | 390 ++ official/release-3.4.4/api/gpu.zig | 1123 +++++ official/release-3.4.4/api/guid.zig | 13 + official/release-3.4.4/api/haptic.zig | 239 ++ official/release-3.4.4/api/hints.zig | 41 + official/release-3.4.4/api/init.zig | 75 + official/release-3.4.4/api/iostream.zig | 221 + official/release-3.4.4/api/joystick.zig | 307 ++ official/release-3.4.4/api/keyboard.zig | 131 + official/release-3.4.4/api/keycode.zig | 5 + official/release-3.4.4/api/loadso.zig | 19 + official/release-3.4.4/api/messagebox.zig | 70 + official/release-3.4.4/api/misc.zig | 5 + official/release-3.4.4/api/mouse.zig | 155 + official/release-3.4.4/api/opengl.zig | 2 + official/release-3.4.4/api/pen.zig | 39 + official/release-3.4.4/api/pixels.zig | 311 ++ official/release-3.4.4/api/power.zig | 14 + official/release-3.4.4/api/process.zig | 52 + official/release-3.4.4/api/properties.zig | 100 + official/release-3.4.4/api/rect.zig | 65 + official/release-3.4.4/api/render.zig | 553 +++ official/release-3.4.4/api/scancode.zig | 253 ++ official/release-3.4.4/api/sensor.zig | 77 + official/release-3.4.4/api/stdinc.zig | 3 + official/release-3.4.4/api/storage.zig | 97 + official/release-3.4.4/api/surface.zig | 305 ++ official/release-3.4.4/api/system.zig | 160 + official/release-3.4.4/api/time.zig | 64 + official/release-3.4.4/api/timer.zig | 47 + official/release-3.4.4/api/touch.zig | 35 + official/release-3.4.4/api/tray.zig | 116 + official/release-3.4.4/api/version.zig | 9 + official/release-3.4.4/api/video.zig | 623 +++ official/release-3.4.4/json/audio.json | 918 ++++ official/release-3.4.4/json/blendmode.json | 134 + official/release-3.4.4/json/camera.json | 248 ++ official/release-3.4.4/json/clipboard.json | 125 + official/release-3.4.4/json/dialog.json | 158 + official/release-3.4.4/json/endian.json | 12 + official/release-3.4.4/json/error.json | 28 + official/release-3.4.4/json/events.json | 2529 +++++++++++ official/release-3.4.4/json/filesystem.json | 287 ++ official/release-3.4.4/json/gamepad.json | 1169 +++++ official/release-3.4.4/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.4/json/guid.json | 51 + official/release-3.4.4/json/haptic.json | 806 ++++ official/release-3.4.4/json/hints.json | 139 + official/release-3.4.4/json/init.json | 202 + official/release-3.4.4/json/iostream.json | 737 ++++ official/release-3.4.4/json/joystick.json | 973 +++++ official/release-3.4.4/json/keyboard.json | 332 ++ official/release-3.4.4/json/keycode.json | 21 + official/release-3.4.4/json/loadso.json | 51 + official/release-3.4.4/json/messagebox.json | 205 + official/release-3.4.4/json/misc.json | 23 + official/release-3.4.4/json/mouse.json | 440 ++ official/release-3.4.4/json/opengl.json | 12 + official/release-3.4.4/json/pen.json | 135 + official/release-3.4.4/json/pixels.json | 1214 ++++++ official/release-3.4.4/json/power.json | 58 + official/release-3.4.4/json/process.json | 153 + official/release-3.4.4/json/properties.json | 369 ++ official/release-3.4.4/json/rect.json | 278 ++ official/release-3.4.4/json/render.json | 1930 +++++++++ official/release-3.4.4/json/scancode.json | 1083 +++++ official/release-3.4.4/json/sensor.json | 207 + official/release-3.4.4/json/storage.json | 349 ++ official/release-3.4.4/json/surface.json | 1326 ++++++ official/release-3.4.4/json/system.json | 359 ++ official/release-3.4.4/json/time.json | 238 ++ official/release-3.4.4/json/timer.json | 121 + official/release-3.4.4/json/touch.json | 114 + official/release-3.4.4/json/tray.json | 332 ++ official/release-3.4.4/json/version.json | 23 + official/release-3.4.4/json/video.json | 1894 +++++++++ official/release-3.4.6/api/audio.zig | 271 ++ official/release-3.4.6/api/blendmode.zig | 28 + official/release-3.4.6/api/c.zig | 1 + official/release-3.4.6/api/camera.zig | 95 + official/release-3.4.6/api/clipboard.zig | 49 + official/release-3.4.6/api/dialog.zig | 36 + official/release-3.4.6/api/endian.zig | 2 + official/release-3.4.6/api/error.zig | 18 + official/release-3.4.6/api/events.zig | 687 +++ official/release-3.4.6/api/filesystem.zig | 95 + official/release-3.4.6/api/gamepad.zig | 390 ++ official/release-3.4.6/api/gpu.zig | 1123 +++++ official/release-3.4.6/api/guid.zig | 13 + official/release-3.4.6/api/haptic.zig | 239 ++ official/release-3.4.6/api/hints.zig | 41 + official/release-3.4.6/api/init.zig | 75 + official/release-3.4.6/api/iostream.zig | 221 + official/release-3.4.6/api/joystick.zig | 307 ++ official/release-3.4.6/api/keyboard.zig | 131 + official/release-3.4.6/api/keycode.zig | 5 + official/release-3.4.6/api/loadso.zig | 19 + official/release-3.4.6/api/messagebox.zig | 70 + official/release-3.4.6/api/misc.zig | 5 + official/release-3.4.6/api/mouse.zig | 155 + official/release-3.4.6/api/opengl.zig | 2 + official/release-3.4.6/api/pen.zig | 39 + official/release-3.4.6/api/pixels.zig | 311 ++ official/release-3.4.6/api/power.zig | 14 + official/release-3.4.6/api/process.zig | 52 + official/release-3.4.6/api/properties.zig | 100 + official/release-3.4.6/api/rect.zig | 65 + official/release-3.4.6/api/render.zig | 553 +++ official/release-3.4.6/api/scancode.zig | 253 ++ official/release-3.4.6/api/sensor.zig | 77 + official/release-3.4.6/api/stdinc.zig | 3 + official/release-3.4.6/api/storage.zig | 97 + official/release-3.4.6/api/surface.zig | 305 ++ official/release-3.4.6/api/system.zig | 160 + official/release-3.4.6/api/time.zig | 64 + official/release-3.4.6/api/timer.zig | 47 + official/release-3.4.6/api/touch.zig | 35 + official/release-3.4.6/api/tray.zig | 116 + official/release-3.4.6/api/version.zig | 9 + official/release-3.4.6/api/video.zig | 623 +++ official/release-3.4.6/json/audio.json | 918 ++++ official/release-3.4.6/json/blendmode.json | 134 + official/release-3.4.6/json/camera.json | 248 ++ official/release-3.4.6/json/clipboard.json | 125 + official/release-3.4.6/json/dialog.json | 158 + official/release-3.4.6/json/endian.json | 12 + official/release-3.4.6/json/error.json | 28 + official/release-3.4.6/json/events.json | 2529 +++++++++++ official/release-3.4.6/json/filesystem.json | 287 ++ official/release-3.4.6/json/gamepad.json | 1169 +++++ official/release-3.4.6/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.6/json/guid.json | 51 + official/release-3.4.6/json/haptic.json | 806 ++++ official/release-3.4.6/json/hints.json | 139 + official/release-3.4.6/json/init.json | 202 + official/release-3.4.6/json/iostream.json | 737 ++++ official/release-3.4.6/json/joystick.json | 973 +++++ official/release-3.4.6/json/keyboard.json | 332 ++ official/release-3.4.6/json/keycode.json | 21 + official/release-3.4.6/json/loadso.json | 51 + official/release-3.4.6/json/messagebox.json | 205 + official/release-3.4.6/json/misc.json | 23 + official/release-3.4.6/json/mouse.json | 440 ++ official/release-3.4.6/json/opengl.json | 12 + official/release-3.4.6/json/pen.json | 135 + official/release-3.4.6/json/pixels.json | 1214 ++++++ official/release-3.4.6/json/power.json | 58 + official/release-3.4.6/json/process.json | 153 + official/release-3.4.6/json/properties.json | 369 ++ official/release-3.4.6/json/rect.json | 278 ++ official/release-3.4.6/json/render.json | 1930 +++++++++ official/release-3.4.6/json/scancode.json | 1083 +++++ official/release-3.4.6/json/sensor.json | 207 + official/release-3.4.6/json/storage.json | 349 ++ official/release-3.4.6/json/surface.json | 1326 ++++++ official/release-3.4.6/json/system.json | 359 ++ official/release-3.4.6/json/time.json | 238 ++ official/release-3.4.6/json/timer.json | 121 + official/release-3.4.6/json/touch.json | 114 + official/release-3.4.6/json/tray.json | 332 ++ official/release-3.4.6/json/version.json | 23 + official/release-3.4.6/json/video.json | 1894 +++++++++ official/release-3.4.8/api/audio.zig | 271 ++ official/release-3.4.8/api/blendmode.zig | 28 + official/release-3.4.8/api/c.zig | 1 + official/release-3.4.8/api/camera.zig | 95 + official/release-3.4.8/api/clipboard.zig | 49 + official/release-3.4.8/api/dialog.zig | 36 + official/release-3.4.8/api/endian.zig | 2 + official/release-3.4.8/api/error.zig | 18 + official/release-3.4.8/api/events.zig | 687 +++ official/release-3.4.8/api/filesystem.zig | 95 + official/release-3.4.8/api/gamepad.zig | 390 ++ official/release-3.4.8/api/gpu.zig | 1123 +++++ official/release-3.4.8/api/guid.zig | 13 + official/release-3.4.8/api/haptic.zig | 239 ++ official/release-3.4.8/api/hints.zig | 41 + official/release-3.4.8/api/init.zig | 75 + official/release-3.4.8/api/iostream.zig | 221 + official/release-3.4.8/api/joystick.zig | 307 ++ official/release-3.4.8/api/keyboard.zig | 131 + official/release-3.4.8/api/keycode.zig | 5 + official/release-3.4.8/api/loadso.zig | 19 + official/release-3.4.8/api/messagebox.zig | 70 + official/release-3.4.8/api/misc.zig | 5 + official/release-3.4.8/api/mouse.zig | 155 + official/release-3.4.8/api/opengl.zig | 2 + official/release-3.4.8/api/pen.zig | 39 + official/release-3.4.8/api/pixels.zig | 311 ++ official/release-3.4.8/api/power.zig | 14 + official/release-3.4.8/api/process.zig | 52 + official/release-3.4.8/api/properties.zig | 100 + official/release-3.4.8/api/rect.zig | 65 + official/release-3.4.8/api/render.zig | 553 +++ official/release-3.4.8/api/scancode.zig | 253 ++ official/release-3.4.8/api/sensor.zig | 77 + official/release-3.4.8/api/stdinc.zig | 3 + official/release-3.4.8/api/storage.zig | 97 + official/release-3.4.8/api/surface.zig | 305 ++ official/release-3.4.8/api/system.zig | 160 + official/release-3.4.8/api/time.zig | 64 + official/release-3.4.8/api/timer.zig | 47 + official/release-3.4.8/api/touch.zig | 35 + official/release-3.4.8/api/tray.zig | 116 + official/release-3.4.8/api/version.zig | 9 + official/release-3.4.8/api/video.zig | 623 +++ official/release-3.4.8/json/audio.json | 918 ++++ official/release-3.4.8/json/blendmode.json | 134 + official/release-3.4.8/json/camera.json | 248 ++ official/release-3.4.8/json/clipboard.json | 125 + official/release-3.4.8/json/dialog.json | 158 + official/release-3.4.8/json/endian.json | 12 + official/release-3.4.8/json/error.json | 28 + official/release-3.4.8/json/events.json | 2529 +++++++++++ official/release-3.4.8/json/filesystem.json | 287 ++ official/release-3.4.8/json/gamepad.json | 1169 +++++ official/release-3.4.8/json/gpu.json | 3988 ++++++++++++++++++ official/release-3.4.8/json/guid.json | 51 + official/release-3.4.8/json/haptic.json | 806 ++++ official/release-3.4.8/json/hints.json | 139 + official/release-3.4.8/json/init.json | 202 + official/release-3.4.8/json/iostream.json | 737 ++++ official/release-3.4.8/json/joystick.json | 973 +++++ official/release-3.4.8/json/keyboard.json | 332 ++ official/release-3.4.8/json/keycode.json | 21 + official/release-3.4.8/json/loadso.json | 51 + official/release-3.4.8/json/messagebox.json | 205 + official/release-3.4.8/json/misc.json | 23 + official/release-3.4.8/json/mouse.json | 440 ++ official/release-3.4.8/json/opengl.json | 12 + official/release-3.4.8/json/pen.json | 135 + official/release-3.4.8/json/pixels.json | 1214 ++++++ official/release-3.4.8/json/power.json | 58 + official/release-3.4.8/json/process.json | 153 + official/release-3.4.8/json/properties.json | 369 ++ official/release-3.4.8/json/rect.json | 278 ++ official/release-3.4.8/json/render.json | 1930 +++++++++ official/release-3.4.8/json/scancode.json | 1083 +++++ official/release-3.4.8/json/sensor.json | 207 + official/release-3.4.8/json/storage.json | 349 ++ official/release-3.4.8/json/surface.json | 1326 ++++++ official/release-3.4.8/json/system.json | 359 ++ official/release-3.4.8/json/time.json | 238 ++ official/release-3.4.8/json/timer.json | 121 + official/release-3.4.8/json/touch.json | 114 + official/release-3.4.8/json/tray.json | 332 ++ official/release-3.4.8/json/version.json | 23 + official/release-3.4.8/json/video.json | 1894 +++++++++ 1634 files changed, 584872 insertions(+) create mode 100644 castholm/v0.4.1-3.4.2/api/audio.zig create mode 100644 castholm/v0.4.1-3.4.2/api/blendmode.zig create mode 100644 castholm/v0.4.1-3.4.2/api/c.zig create mode 100644 castholm/v0.4.1-3.4.2/api/camera.zig create mode 100644 castholm/v0.4.1-3.4.2/api/clipboard.zig create mode 100644 castholm/v0.4.1-3.4.2/api/dialog.zig create mode 100644 castholm/v0.4.1-3.4.2/api/endian.zig create mode 100644 castholm/v0.4.1-3.4.2/api/error.zig create mode 100644 castholm/v0.4.1-3.4.2/api/events.zig create mode 100644 castholm/v0.4.1-3.4.2/api/filesystem.zig create mode 100644 castholm/v0.4.1-3.4.2/api/gamepad.zig create mode 100644 castholm/v0.4.1-3.4.2/api/gpu.zig create mode 100644 castholm/v0.4.1-3.4.2/api/guid.zig create mode 100644 castholm/v0.4.1-3.4.2/api/haptic.zig create mode 100644 castholm/v0.4.1-3.4.2/api/hints.zig create mode 100644 castholm/v0.4.1-3.4.2/api/init.zig create mode 100644 castholm/v0.4.1-3.4.2/api/iostream.zig create mode 100644 castholm/v0.4.1-3.4.2/api/joystick.zig create mode 100644 castholm/v0.4.1-3.4.2/api/keyboard.zig create mode 100644 castholm/v0.4.1-3.4.2/api/keycode.zig create mode 100644 castholm/v0.4.1-3.4.2/api/loadso.zig create mode 100644 castholm/v0.4.1-3.4.2/api/messagebox.zig create mode 100644 castholm/v0.4.1-3.4.2/api/misc.zig create mode 100644 castholm/v0.4.1-3.4.2/api/mouse.zig create mode 100644 castholm/v0.4.1-3.4.2/api/opengl.zig create mode 100644 castholm/v0.4.1-3.4.2/api/pen.zig create mode 100644 castholm/v0.4.1-3.4.2/api/pixels.zig create mode 100644 castholm/v0.4.1-3.4.2/api/power.zig create mode 100644 castholm/v0.4.1-3.4.2/api/process.zig create mode 100644 castholm/v0.4.1-3.4.2/api/properties.zig create mode 100644 castholm/v0.4.1-3.4.2/api/rect.zig create mode 100644 castholm/v0.4.1-3.4.2/api/render.zig create mode 100644 castholm/v0.4.1-3.4.2/api/scancode.zig create mode 100644 castholm/v0.4.1-3.4.2/api/sensor.zig create mode 100644 castholm/v0.4.1-3.4.2/api/stdinc.zig create mode 100644 castholm/v0.4.1-3.4.2/api/storage.zig create mode 100644 castholm/v0.4.1-3.4.2/api/surface.zig create mode 100644 castholm/v0.4.1-3.4.2/api/system.zig create mode 100644 castholm/v0.4.1-3.4.2/api/time.zig create mode 100644 castholm/v0.4.1-3.4.2/api/timer.zig create mode 100644 castholm/v0.4.1-3.4.2/api/touch.zig create mode 100644 castholm/v0.4.1-3.4.2/api/tray.zig create mode 100644 castholm/v0.4.1-3.4.2/api/version.zig create mode 100644 castholm/v0.4.1-3.4.2/api/video.zig create mode 100644 castholm/v0.4.1-3.4.2/json/audio.json create mode 100644 castholm/v0.4.1-3.4.2/json/blendmode.json create mode 100644 castholm/v0.4.1-3.4.2/json/camera.json create mode 100644 castholm/v0.4.1-3.4.2/json/clipboard.json create mode 100644 castholm/v0.4.1-3.4.2/json/dialog.json create mode 100644 castholm/v0.4.1-3.4.2/json/endian.json create mode 100644 castholm/v0.4.1-3.4.2/json/error.json create mode 100644 castholm/v0.4.1-3.4.2/json/events.json create mode 100644 castholm/v0.4.1-3.4.2/json/filesystem.json create mode 100644 castholm/v0.4.1-3.4.2/json/gamepad.json create mode 100644 castholm/v0.4.1-3.4.2/json/gpu.json create mode 100644 castholm/v0.4.1-3.4.2/json/guid.json create mode 100644 castholm/v0.4.1-3.4.2/json/haptic.json create mode 100644 castholm/v0.4.1-3.4.2/json/hints.json create mode 100644 castholm/v0.4.1-3.4.2/json/init.json create mode 100644 castholm/v0.4.1-3.4.2/json/iostream.json create mode 100644 castholm/v0.4.1-3.4.2/json/joystick.json create mode 100644 castholm/v0.4.1-3.4.2/json/keyboard.json create mode 100644 castholm/v0.4.1-3.4.2/json/keycode.json create mode 100644 castholm/v0.4.1-3.4.2/json/loadso.json create mode 100644 castholm/v0.4.1-3.4.2/json/messagebox.json create mode 100644 castholm/v0.4.1-3.4.2/json/misc.json create mode 100644 castholm/v0.4.1-3.4.2/json/mouse.json create mode 100644 castholm/v0.4.1-3.4.2/json/opengl.json create mode 100644 castholm/v0.4.1-3.4.2/json/pen.json create mode 100644 castholm/v0.4.1-3.4.2/json/pixels.json create mode 100644 castholm/v0.4.1-3.4.2/json/power.json create mode 100644 castholm/v0.4.1-3.4.2/json/process.json create mode 100644 castholm/v0.4.1-3.4.2/json/properties.json create mode 100644 castholm/v0.4.1-3.4.2/json/rect.json create mode 100644 castholm/v0.4.1-3.4.2/json/render.json create mode 100644 castholm/v0.4.1-3.4.2/json/scancode.json create mode 100644 castholm/v0.4.1-3.4.2/json/sensor.json create mode 100644 castholm/v0.4.1-3.4.2/json/storage.json create mode 100644 castholm/v0.4.1-3.4.2/json/surface.json create mode 100644 castholm/v0.4.1-3.4.2/json/system.json create mode 100644 castholm/v0.4.1-3.4.2/json/time.json create mode 100644 castholm/v0.4.1-3.4.2/json/timer.json create mode 100644 castholm/v0.4.1-3.4.2/json/touch.json create mode 100644 castholm/v0.4.1-3.4.2/json/tray.json create mode 100644 castholm/v0.4.1-3.4.2/json/version.json create mode 100644 castholm/v0.4.1-3.4.2/json/video.json create mode 100644 castholm/v0.4.2-3.4.4/api/audio.zig create mode 100644 castholm/v0.4.2-3.4.4/api/blendmode.zig create mode 100644 castholm/v0.4.2-3.4.4/api/c.zig create mode 100644 castholm/v0.4.2-3.4.4/api/camera.zig create mode 100644 castholm/v0.4.2-3.4.4/api/clipboard.zig create mode 100644 castholm/v0.4.2-3.4.4/api/dialog.zig create mode 100644 castholm/v0.4.2-3.4.4/api/endian.zig create mode 100644 castholm/v0.4.2-3.4.4/api/error.zig create mode 100644 castholm/v0.4.2-3.4.4/api/events.zig create mode 100644 castholm/v0.4.2-3.4.4/api/filesystem.zig create mode 100644 castholm/v0.4.2-3.4.4/api/gamepad.zig create mode 100644 castholm/v0.4.2-3.4.4/api/gpu.zig create mode 100644 castholm/v0.4.2-3.4.4/api/guid.zig create mode 100644 castholm/v0.4.2-3.4.4/api/haptic.zig create mode 100644 castholm/v0.4.2-3.4.4/api/hints.zig create mode 100644 castholm/v0.4.2-3.4.4/api/init.zig create mode 100644 castholm/v0.4.2-3.4.4/api/iostream.zig create mode 100644 castholm/v0.4.2-3.4.4/api/joystick.zig create mode 100644 castholm/v0.4.2-3.4.4/api/keyboard.zig create mode 100644 castholm/v0.4.2-3.4.4/api/keycode.zig create mode 100644 castholm/v0.4.2-3.4.4/api/loadso.zig create mode 100644 castholm/v0.4.2-3.4.4/api/messagebox.zig create mode 100644 castholm/v0.4.2-3.4.4/api/misc.zig create mode 100644 castholm/v0.4.2-3.4.4/api/mouse.zig create mode 100644 castholm/v0.4.2-3.4.4/api/opengl.zig create mode 100644 castholm/v0.4.2-3.4.4/api/pen.zig create mode 100644 castholm/v0.4.2-3.4.4/api/pixels.zig create mode 100644 castholm/v0.4.2-3.4.4/api/power.zig create mode 100644 castholm/v0.4.2-3.4.4/api/process.zig create mode 100644 castholm/v0.4.2-3.4.4/api/properties.zig create mode 100644 castholm/v0.4.2-3.4.4/api/rect.zig create mode 100644 castholm/v0.4.2-3.4.4/api/render.zig create mode 100644 castholm/v0.4.2-3.4.4/api/scancode.zig create mode 100644 castholm/v0.4.2-3.4.4/api/sensor.zig create mode 100644 castholm/v0.4.2-3.4.4/api/stdinc.zig create mode 100644 castholm/v0.4.2-3.4.4/api/storage.zig create mode 100644 castholm/v0.4.2-3.4.4/api/surface.zig create mode 100644 castholm/v0.4.2-3.4.4/api/system.zig create mode 100644 castholm/v0.4.2-3.4.4/api/time.zig create mode 100644 castholm/v0.4.2-3.4.4/api/timer.zig create mode 100644 castholm/v0.4.2-3.4.4/api/touch.zig create mode 100644 castholm/v0.4.2-3.4.4/api/tray.zig create mode 100644 castholm/v0.4.2-3.4.4/api/version.zig create mode 100644 castholm/v0.4.2-3.4.4/api/video.zig create mode 100644 castholm/v0.4.2-3.4.4/json/audio.json create mode 100644 castholm/v0.4.2-3.4.4/json/blendmode.json create mode 100644 castholm/v0.4.2-3.4.4/json/camera.json create mode 100644 castholm/v0.4.2-3.4.4/json/clipboard.json create mode 100644 castholm/v0.4.2-3.4.4/json/dialog.json create mode 100644 castholm/v0.4.2-3.4.4/json/endian.json create mode 100644 castholm/v0.4.2-3.4.4/json/error.json create mode 100644 castholm/v0.4.2-3.4.4/json/events.json create mode 100644 castholm/v0.4.2-3.4.4/json/filesystem.json create mode 100644 castholm/v0.4.2-3.4.4/json/gamepad.json create mode 100644 castholm/v0.4.2-3.4.4/json/gpu.json create mode 100644 castholm/v0.4.2-3.4.4/json/guid.json create mode 100644 castholm/v0.4.2-3.4.4/json/haptic.json create mode 100644 castholm/v0.4.2-3.4.4/json/hints.json create mode 100644 castholm/v0.4.2-3.4.4/json/init.json create mode 100644 castholm/v0.4.2-3.4.4/json/iostream.json create mode 100644 castholm/v0.4.2-3.4.4/json/joystick.json create mode 100644 castholm/v0.4.2-3.4.4/json/keyboard.json create mode 100644 castholm/v0.4.2-3.4.4/json/keycode.json create mode 100644 castholm/v0.4.2-3.4.4/json/loadso.json create mode 100644 castholm/v0.4.2-3.4.4/json/messagebox.json create mode 100644 castholm/v0.4.2-3.4.4/json/misc.json create mode 100644 castholm/v0.4.2-3.4.4/json/mouse.json create mode 100644 castholm/v0.4.2-3.4.4/json/opengl.json create mode 100644 castholm/v0.4.2-3.4.4/json/pen.json create mode 100644 castholm/v0.4.2-3.4.4/json/pixels.json create mode 100644 castholm/v0.4.2-3.4.4/json/power.json create mode 100644 castholm/v0.4.2-3.4.4/json/process.json create mode 100644 castholm/v0.4.2-3.4.4/json/properties.json create mode 100644 castholm/v0.4.2-3.4.4/json/rect.json create mode 100644 castholm/v0.4.2-3.4.4/json/render.json create mode 100644 castholm/v0.4.2-3.4.4/json/scancode.json create mode 100644 castholm/v0.4.2-3.4.4/json/sensor.json create mode 100644 castholm/v0.4.2-3.4.4/json/storage.json create mode 100644 castholm/v0.4.2-3.4.4/json/surface.json create mode 100644 castholm/v0.4.2-3.4.4/json/system.json create mode 100644 castholm/v0.4.2-3.4.4/json/time.json create mode 100644 castholm/v0.4.2-3.4.4/json/timer.json create mode 100644 castholm/v0.4.2-3.4.4/json/touch.json create mode 100644 castholm/v0.4.2-3.4.4/json/tray.json create mode 100644 castholm/v0.4.2-3.4.4/json/version.json create mode 100644 castholm/v0.4.2-3.4.4/json/video.json create mode 100644 castholm/v0.5.0-3.4.8/api/audio.zig create mode 100644 castholm/v0.5.0-3.4.8/api/blendmode.zig create mode 100644 castholm/v0.5.0-3.4.8/api/c.zig create mode 100644 castholm/v0.5.0-3.4.8/api/camera.zig create mode 100644 castholm/v0.5.0-3.4.8/api/clipboard.zig create mode 100644 castholm/v0.5.0-3.4.8/api/dialog.zig create mode 100644 castholm/v0.5.0-3.4.8/api/endian.zig create mode 100644 castholm/v0.5.0-3.4.8/api/error.zig create mode 100644 castholm/v0.5.0-3.4.8/api/events.zig create mode 100644 castholm/v0.5.0-3.4.8/api/filesystem.zig create mode 100644 castholm/v0.5.0-3.4.8/api/gamepad.zig create mode 100644 castholm/v0.5.0-3.4.8/api/gpu.zig create mode 100644 castholm/v0.5.0-3.4.8/api/guid.zig create mode 100644 castholm/v0.5.0-3.4.8/api/haptic.zig create mode 100644 castholm/v0.5.0-3.4.8/api/hints.zig create mode 100644 castholm/v0.5.0-3.4.8/api/init.zig create mode 100644 castholm/v0.5.0-3.4.8/api/iostream.zig create mode 100644 castholm/v0.5.0-3.4.8/api/joystick.zig create mode 100644 castholm/v0.5.0-3.4.8/api/keyboard.zig create mode 100644 castholm/v0.5.0-3.4.8/api/keycode.zig create mode 100644 castholm/v0.5.0-3.4.8/api/loadso.zig create mode 100644 castholm/v0.5.0-3.4.8/api/messagebox.zig create mode 100644 castholm/v0.5.0-3.4.8/api/misc.zig create mode 100644 castholm/v0.5.0-3.4.8/api/mouse.zig create mode 100644 castholm/v0.5.0-3.4.8/api/opengl.zig create mode 100644 castholm/v0.5.0-3.4.8/api/pen.zig create mode 100644 castholm/v0.5.0-3.4.8/api/pixels.zig create mode 100644 castholm/v0.5.0-3.4.8/api/power.zig create mode 100644 castholm/v0.5.0-3.4.8/api/process.zig create mode 100644 castholm/v0.5.0-3.4.8/api/properties.zig create mode 100644 castholm/v0.5.0-3.4.8/api/rect.zig create mode 100644 castholm/v0.5.0-3.4.8/api/render.zig create mode 100644 castholm/v0.5.0-3.4.8/api/scancode.zig create mode 100644 castholm/v0.5.0-3.4.8/api/sensor.zig create mode 100644 castholm/v0.5.0-3.4.8/api/stdinc.zig create mode 100644 castholm/v0.5.0-3.4.8/api/storage.zig create mode 100644 castholm/v0.5.0-3.4.8/api/surface.zig create mode 100644 castholm/v0.5.0-3.4.8/api/system.zig create mode 100644 castholm/v0.5.0-3.4.8/api/time.zig create mode 100644 castholm/v0.5.0-3.4.8/api/timer.zig create mode 100644 castholm/v0.5.0-3.4.8/api/touch.zig create mode 100644 castholm/v0.5.0-3.4.8/api/tray.zig create mode 100644 castholm/v0.5.0-3.4.8/api/version.zig create mode 100644 castholm/v0.5.0-3.4.8/api/video.zig create mode 100644 castholm/v0.5.0-3.4.8/json/audio.json create mode 100644 castholm/v0.5.0-3.4.8/json/blendmode.json create mode 100644 castholm/v0.5.0-3.4.8/json/camera.json create mode 100644 castholm/v0.5.0-3.4.8/json/clipboard.json create mode 100644 castholm/v0.5.0-3.4.8/json/dialog.json create mode 100644 castholm/v0.5.0-3.4.8/json/endian.json create mode 100644 castholm/v0.5.0-3.4.8/json/error.json create mode 100644 castholm/v0.5.0-3.4.8/json/events.json create mode 100644 castholm/v0.5.0-3.4.8/json/filesystem.json create mode 100644 castholm/v0.5.0-3.4.8/json/gamepad.json create mode 100644 castholm/v0.5.0-3.4.8/json/gpu.json create mode 100644 castholm/v0.5.0-3.4.8/json/guid.json create mode 100644 castholm/v0.5.0-3.4.8/json/haptic.json create mode 100644 castholm/v0.5.0-3.4.8/json/hints.json create mode 100644 castholm/v0.5.0-3.4.8/json/init.json create mode 100644 castholm/v0.5.0-3.4.8/json/iostream.json create mode 100644 castholm/v0.5.0-3.4.8/json/joystick.json create mode 100644 castholm/v0.5.0-3.4.8/json/keyboard.json create mode 100644 castholm/v0.5.0-3.4.8/json/keycode.json create mode 100644 castholm/v0.5.0-3.4.8/json/loadso.json create mode 100644 castholm/v0.5.0-3.4.8/json/messagebox.json create mode 100644 castholm/v0.5.0-3.4.8/json/misc.json create mode 100644 castholm/v0.5.0-3.4.8/json/mouse.json create mode 100644 castholm/v0.5.0-3.4.8/json/opengl.json create mode 100644 castholm/v0.5.0-3.4.8/json/pen.json create mode 100644 castholm/v0.5.0-3.4.8/json/pixels.json create mode 100644 castholm/v0.5.0-3.4.8/json/power.json create mode 100644 castholm/v0.5.0-3.4.8/json/process.json create mode 100644 castholm/v0.5.0-3.4.8/json/properties.json create mode 100644 castholm/v0.5.0-3.4.8/json/rect.json create mode 100644 castholm/v0.5.0-3.4.8/json/render.json create mode 100644 castholm/v0.5.0-3.4.8/json/scancode.json create mode 100644 castholm/v0.5.0-3.4.8/json/sensor.json create mode 100644 castholm/v0.5.0-3.4.8/json/storage.json create mode 100644 castholm/v0.5.0-3.4.8/json/surface.json create mode 100644 castholm/v0.5.0-3.4.8/json/system.json create mode 100644 castholm/v0.5.0-3.4.8/json/time.json create mode 100644 castholm/v0.5.0-3.4.8/json/timer.json create mode 100644 castholm/v0.5.0-3.4.8/json/touch.json create mode 100644 castholm/v0.5.0-3.4.8/json/tray.json create mode 100644 castholm/v0.5.0-3.4.8/json/version.json create mode 100644 castholm/v0.5.0-3.4.8/json/video.json create mode 100644 castholm/v0.5.1-3.4.10/api/audio.zig create mode 100644 castholm/v0.5.1-3.4.10/api/blendmode.zig create mode 100644 castholm/v0.5.1-3.4.10/api/c.zig create mode 100644 castholm/v0.5.1-3.4.10/api/camera.zig create mode 100644 castholm/v0.5.1-3.4.10/api/clipboard.zig create mode 100644 castholm/v0.5.1-3.4.10/api/dialog.zig create mode 100644 castholm/v0.5.1-3.4.10/api/endian.zig create mode 100644 castholm/v0.5.1-3.4.10/api/error.zig create mode 100644 castholm/v0.5.1-3.4.10/api/events.zig create mode 100644 castholm/v0.5.1-3.4.10/api/filesystem.zig create mode 100644 castholm/v0.5.1-3.4.10/api/gamepad.zig create mode 100644 castholm/v0.5.1-3.4.10/api/gpu.zig create mode 100644 castholm/v0.5.1-3.4.10/api/guid.zig create mode 100644 castholm/v0.5.1-3.4.10/api/haptic.zig create mode 100644 castholm/v0.5.1-3.4.10/api/hints.zig create mode 100644 castholm/v0.5.1-3.4.10/api/init.zig create mode 100644 castholm/v0.5.1-3.4.10/api/iostream.zig create mode 100644 castholm/v0.5.1-3.4.10/api/joystick.zig create mode 100644 castholm/v0.5.1-3.4.10/api/keyboard.zig create mode 100644 castholm/v0.5.1-3.4.10/api/keycode.zig create mode 100644 castholm/v0.5.1-3.4.10/api/loadso.zig create mode 100644 castholm/v0.5.1-3.4.10/api/messagebox.zig create mode 100644 castholm/v0.5.1-3.4.10/api/misc.zig create mode 100644 castholm/v0.5.1-3.4.10/api/mouse.zig create mode 100644 castholm/v0.5.1-3.4.10/api/opengl.zig create mode 100644 castholm/v0.5.1-3.4.10/api/pen.zig create mode 100644 castholm/v0.5.1-3.4.10/api/pixels.zig create mode 100644 castholm/v0.5.1-3.4.10/api/power.zig create mode 100644 castholm/v0.5.1-3.4.10/api/process.zig create mode 100644 castholm/v0.5.1-3.4.10/api/properties.zig create mode 100644 castholm/v0.5.1-3.4.10/api/rect.zig create mode 100644 castholm/v0.5.1-3.4.10/api/render.zig create mode 100644 castholm/v0.5.1-3.4.10/api/scancode.zig create mode 100644 castholm/v0.5.1-3.4.10/api/sensor.zig create mode 100644 castholm/v0.5.1-3.4.10/api/stdinc.zig create mode 100644 castholm/v0.5.1-3.4.10/api/storage.zig create mode 100644 castholm/v0.5.1-3.4.10/api/surface.zig create mode 100644 castholm/v0.5.1-3.4.10/api/system.zig create mode 100644 castholm/v0.5.1-3.4.10/api/time.zig create mode 100644 castholm/v0.5.1-3.4.10/api/timer.zig create mode 100644 castholm/v0.5.1-3.4.10/api/touch.zig create mode 100644 castholm/v0.5.1-3.4.10/api/tray.zig create mode 100644 castholm/v0.5.1-3.4.10/api/version.zig create mode 100644 castholm/v0.5.1-3.4.10/api/video.zig create mode 100644 castholm/v0.5.1-3.4.10/json/audio.json create mode 100644 castholm/v0.5.1-3.4.10/json/blendmode.json create mode 100644 castholm/v0.5.1-3.4.10/json/camera.json create mode 100644 castholm/v0.5.1-3.4.10/json/clipboard.json create mode 100644 castholm/v0.5.1-3.4.10/json/dialog.json create mode 100644 castholm/v0.5.1-3.4.10/json/endian.json create mode 100644 castholm/v0.5.1-3.4.10/json/error.json create mode 100644 castholm/v0.5.1-3.4.10/json/events.json create mode 100644 castholm/v0.5.1-3.4.10/json/filesystem.json create mode 100644 castholm/v0.5.1-3.4.10/json/gamepad.json create mode 100644 castholm/v0.5.1-3.4.10/json/gpu.json create mode 100644 castholm/v0.5.1-3.4.10/json/guid.json create mode 100644 castholm/v0.5.1-3.4.10/json/haptic.json create mode 100644 castholm/v0.5.1-3.4.10/json/hints.json create mode 100644 castholm/v0.5.1-3.4.10/json/init.json create mode 100644 castholm/v0.5.1-3.4.10/json/iostream.json create mode 100644 castholm/v0.5.1-3.4.10/json/joystick.json create mode 100644 castholm/v0.5.1-3.4.10/json/keyboard.json create mode 100644 castholm/v0.5.1-3.4.10/json/keycode.json create mode 100644 castholm/v0.5.1-3.4.10/json/loadso.json create mode 100644 castholm/v0.5.1-3.4.10/json/messagebox.json create mode 100644 castholm/v0.5.1-3.4.10/json/misc.json create mode 100644 castholm/v0.5.1-3.4.10/json/mouse.json create mode 100644 castholm/v0.5.1-3.4.10/json/opengl.json create mode 100644 castholm/v0.5.1-3.4.10/json/pen.json create mode 100644 castholm/v0.5.1-3.4.10/json/pixels.json create mode 100644 castholm/v0.5.1-3.4.10/json/power.json create mode 100644 castholm/v0.5.1-3.4.10/json/process.json create mode 100644 castholm/v0.5.1-3.4.10/json/properties.json create mode 100644 castholm/v0.5.1-3.4.10/json/rect.json create mode 100644 castholm/v0.5.1-3.4.10/json/render.json create mode 100644 castholm/v0.5.1-3.4.10/json/scancode.json create mode 100644 castholm/v0.5.1-3.4.10/json/sensor.json create mode 100644 castholm/v0.5.1-3.4.10/json/storage.json create mode 100644 castholm/v0.5.1-3.4.10/json/surface.json create mode 100644 castholm/v0.5.1-3.4.10/json/system.json create mode 100644 castholm/v0.5.1-3.4.10/json/time.json create mode 100644 castholm/v0.5.1-3.4.10/json/timer.json create mode 100644 castholm/v0.5.1-3.4.10/json/touch.json create mode 100644 castholm/v0.5.1-3.4.10/json/tray.json create mode 100644 castholm/v0.5.1-3.4.10/json/version.json create mode 100644 castholm/v0.5.1-3.4.10/json/video.json create mode 100644 castholm/v0.5.2-3.4.12/api/audio.zig create mode 100644 castholm/v0.5.2-3.4.12/api/blendmode.zig create mode 100644 castholm/v0.5.2-3.4.12/api/c.zig create mode 100644 castholm/v0.5.2-3.4.12/api/camera.zig create mode 100644 castholm/v0.5.2-3.4.12/api/clipboard.zig create mode 100644 castholm/v0.5.2-3.4.12/api/dialog.zig create mode 100644 castholm/v0.5.2-3.4.12/api/endian.zig create mode 100644 castholm/v0.5.2-3.4.12/api/error.zig create mode 100644 castholm/v0.5.2-3.4.12/api/events.zig create mode 100644 castholm/v0.5.2-3.4.12/api/filesystem.zig create mode 100644 castholm/v0.5.2-3.4.12/api/gamepad.zig create mode 100644 castholm/v0.5.2-3.4.12/api/gpu.zig create mode 100644 castholm/v0.5.2-3.4.12/api/guid.zig create mode 100644 castholm/v0.5.2-3.4.12/api/haptic.zig create mode 100644 castholm/v0.5.2-3.4.12/api/hints.zig create mode 100644 castholm/v0.5.2-3.4.12/api/init.zig create mode 100644 castholm/v0.5.2-3.4.12/api/iostream.zig create mode 100644 castholm/v0.5.2-3.4.12/api/joystick.zig create mode 100644 castholm/v0.5.2-3.4.12/api/keyboard.zig create mode 100644 castholm/v0.5.2-3.4.12/api/keycode.zig create mode 100644 castholm/v0.5.2-3.4.12/api/loadso.zig create mode 100644 castholm/v0.5.2-3.4.12/api/messagebox.zig create mode 100644 castholm/v0.5.2-3.4.12/api/misc.zig create mode 100644 castholm/v0.5.2-3.4.12/api/mouse.zig create mode 100644 castholm/v0.5.2-3.4.12/api/opengl.zig create mode 100644 castholm/v0.5.2-3.4.12/api/pen.zig create mode 100644 castholm/v0.5.2-3.4.12/api/pixels.zig create mode 100644 castholm/v0.5.2-3.4.12/api/power.zig create mode 100644 castholm/v0.5.2-3.4.12/api/process.zig create mode 100644 castholm/v0.5.2-3.4.12/api/properties.zig create mode 100644 castholm/v0.5.2-3.4.12/api/rect.zig create mode 100644 castholm/v0.5.2-3.4.12/api/render.zig create mode 100644 castholm/v0.5.2-3.4.12/api/scancode.zig create mode 100644 castholm/v0.5.2-3.4.12/api/sensor.zig create mode 100644 castholm/v0.5.2-3.4.12/api/stdinc.zig create mode 100644 castholm/v0.5.2-3.4.12/api/storage.zig create mode 100644 castholm/v0.5.2-3.4.12/api/surface.zig create mode 100644 castholm/v0.5.2-3.4.12/api/system.zig create mode 100644 castholm/v0.5.2-3.4.12/api/time.zig create mode 100644 castholm/v0.5.2-3.4.12/api/timer.zig create mode 100644 castholm/v0.5.2-3.4.12/api/touch.zig create mode 100644 castholm/v0.5.2-3.4.12/api/tray.zig create mode 100644 castholm/v0.5.2-3.4.12/api/version.zig create mode 100644 castholm/v0.5.2-3.4.12/api/video.zig create mode 100644 castholm/v0.5.2-3.4.12/json/audio.json create mode 100644 castholm/v0.5.2-3.4.12/json/blendmode.json create mode 100644 castholm/v0.5.2-3.4.12/json/camera.json create mode 100644 castholm/v0.5.2-3.4.12/json/clipboard.json create mode 100644 castholm/v0.5.2-3.4.12/json/dialog.json create mode 100644 castholm/v0.5.2-3.4.12/json/endian.json create mode 100644 castholm/v0.5.2-3.4.12/json/error.json create mode 100644 castholm/v0.5.2-3.4.12/json/events.json create mode 100644 castholm/v0.5.2-3.4.12/json/filesystem.json create mode 100644 castholm/v0.5.2-3.4.12/json/gamepad.json create mode 100644 castholm/v0.5.2-3.4.12/json/gpu.json create mode 100644 castholm/v0.5.2-3.4.12/json/guid.json create mode 100644 castholm/v0.5.2-3.4.12/json/haptic.json create mode 100644 castholm/v0.5.2-3.4.12/json/hints.json create mode 100644 castholm/v0.5.2-3.4.12/json/init.json create mode 100644 castholm/v0.5.2-3.4.12/json/iostream.json create mode 100644 castholm/v0.5.2-3.4.12/json/joystick.json create mode 100644 castholm/v0.5.2-3.4.12/json/keyboard.json create mode 100644 castholm/v0.5.2-3.4.12/json/keycode.json create mode 100644 castholm/v0.5.2-3.4.12/json/loadso.json create mode 100644 castholm/v0.5.2-3.4.12/json/messagebox.json create mode 100644 castholm/v0.5.2-3.4.12/json/misc.json create mode 100644 castholm/v0.5.2-3.4.12/json/mouse.json create mode 100644 castholm/v0.5.2-3.4.12/json/opengl.json create mode 100644 castholm/v0.5.2-3.4.12/json/pen.json create mode 100644 castholm/v0.5.2-3.4.12/json/pixels.json create mode 100644 castholm/v0.5.2-3.4.12/json/power.json create mode 100644 castholm/v0.5.2-3.4.12/json/process.json create mode 100644 castholm/v0.5.2-3.4.12/json/properties.json create mode 100644 castholm/v0.5.2-3.4.12/json/rect.json create mode 100644 castholm/v0.5.2-3.4.12/json/render.json create mode 100644 castholm/v0.5.2-3.4.12/json/scancode.json create mode 100644 castholm/v0.5.2-3.4.12/json/sensor.json create mode 100644 castholm/v0.5.2-3.4.12/json/storage.json create mode 100644 castholm/v0.5.2-3.4.12/json/surface.json create mode 100644 castholm/v0.5.2-3.4.12/json/system.json create mode 100644 castholm/v0.5.2-3.4.12/json/time.json create mode 100644 castholm/v0.5.2-3.4.12/json/timer.json create mode 100644 castholm/v0.5.2-3.4.12/json/touch.json create mode 100644 castholm/v0.5.2-3.4.12/json/tray.json create mode 100644 castholm/v0.5.2-3.4.12/json/version.json create mode 100644 castholm/v0.5.2-3.4.12/json/video.json create mode 100644 castholm/v0.5.3-3.4.14/api/audio.zig create mode 100644 castholm/v0.5.3-3.4.14/api/blendmode.zig create mode 100644 castholm/v0.5.3-3.4.14/api/c.zig create mode 100644 castholm/v0.5.3-3.4.14/api/camera.zig create mode 100644 castholm/v0.5.3-3.4.14/api/clipboard.zig create mode 100644 castholm/v0.5.3-3.4.14/api/dialog.zig create mode 100644 castholm/v0.5.3-3.4.14/api/endian.zig create mode 100644 castholm/v0.5.3-3.4.14/api/error.zig create mode 100644 castholm/v0.5.3-3.4.14/api/events.zig create mode 100644 castholm/v0.5.3-3.4.14/api/filesystem.zig create mode 100644 castholm/v0.5.3-3.4.14/api/gamepad.zig create mode 100644 castholm/v0.5.3-3.4.14/api/gpu.zig create mode 100644 castholm/v0.5.3-3.4.14/api/guid.zig create mode 100644 castholm/v0.5.3-3.4.14/api/haptic.zig create mode 100644 castholm/v0.5.3-3.4.14/api/hints.zig create mode 100644 castholm/v0.5.3-3.4.14/api/init.zig create mode 100644 castholm/v0.5.3-3.4.14/api/iostream.zig create mode 100644 castholm/v0.5.3-3.4.14/api/joystick.zig create mode 100644 castholm/v0.5.3-3.4.14/api/keyboard.zig create mode 100644 castholm/v0.5.3-3.4.14/api/keycode.zig create mode 100644 castholm/v0.5.3-3.4.14/api/loadso.zig create mode 100644 castholm/v0.5.3-3.4.14/api/messagebox.zig create mode 100644 castholm/v0.5.3-3.4.14/api/misc.zig create mode 100644 castholm/v0.5.3-3.4.14/api/mouse.zig create mode 100644 castholm/v0.5.3-3.4.14/api/opengl.zig create mode 100644 castholm/v0.5.3-3.4.14/api/pen.zig create mode 100644 castholm/v0.5.3-3.4.14/api/pixels.zig create mode 100644 castholm/v0.5.3-3.4.14/api/power.zig create mode 100644 castholm/v0.5.3-3.4.14/api/process.zig create mode 100644 castholm/v0.5.3-3.4.14/api/properties.zig create mode 100644 castholm/v0.5.3-3.4.14/api/rect.zig create mode 100644 castholm/v0.5.3-3.4.14/api/render.zig create mode 100644 castholm/v0.5.3-3.4.14/api/scancode.zig create mode 100644 castholm/v0.5.3-3.4.14/api/sensor.zig create mode 100644 castholm/v0.5.3-3.4.14/api/stdinc.zig create mode 100644 castholm/v0.5.3-3.4.14/api/storage.zig create mode 100644 castholm/v0.5.3-3.4.14/api/surface.zig create mode 100644 castholm/v0.5.3-3.4.14/api/system.zig create mode 100644 castholm/v0.5.3-3.4.14/api/time.zig create mode 100644 castholm/v0.5.3-3.4.14/api/timer.zig create mode 100644 castholm/v0.5.3-3.4.14/api/touch.zig create mode 100644 castholm/v0.5.3-3.4.14/api/tray.zig create mode 100644 castholm/v0.5.3-3.4.14/api/version.zig create mode 100644 castholm/v0.5.3-3.4.14/api/video.zig create mode 100644 castholm/v0.5.3-3.4.14/json/audio.json create mode 100644 castholm/v0.5.3-3.4.14/json/blendmode.json create mode 100644 castholm/v0.5.3-3.4.14/json/camera.json create mode 100644 castholm/v0.5.3-3.4.14/json/clipboard.json create mode 100644 castholm/v0.5.3-3.4.14/json/dialog.json create mode 100644 castholm/v0.5.3-3.4.14/json/endian.json create mode 100644 castholm/v0.5.3-3.4.14/json/error.json create mode 100644 castholm/v0.5.3-3.4.14/json/events.json create mode 100644 castholm/v0.5.3-3.4.14/json/filesystem.json create mode 100644 castholm/v0.5.3-3.4.14/json/gamepad.json create mode 100644 castholm/v0.5.3-3.4.14/json/gpu.json create mode 100644 castholm/v0.5.3-3.4.14/json/guid.json create mode 100644 castholm/v0.5.3-3.4.14/json/haptic.json create mode 100644 castholm/v0.5.3-3.4.14/json/hints.json create mode 100644 castholm/v0.5.3-3.4.14/json/init.json create mode 100644 castholm/v0.5.3-3.4.14/json/iostream.json create mode 100644 castholm/v0.5.3-3.4.14/json/joystick.json create mode 100644 castholm/v0.5.3-3.4.14/json/keyboard.json create mode 100644 castholm/v0.5.3-3.4.14/json/keycode.json create mode 100644 castholm/v0.5.3-3.4.14/json/loadso.json create mode 100644 castholm/v0.5.3-3.4.14/json/messagebox.json create mode 100644 castholm/v0.5.3-3.4.14/json/misc.json create mode 100644 castholm/v0.5.3-3.4.14/json/mouse.json create mode 100644 castholm/v0.5.3-3.4.14/json/opengl.json create mode 100644 castholm/v0.5.3-3.4.14/json/pen.json create mode 100644 castholm/v0.5.3-3.4.14/json/pixels.json create mode 100644 castholm/v0.5.3-3.4.14/json/power.json create mode 100644 castholm/v0.5.3-3.4.14/json/process.json create mode 100644 castholm/v0.5.3-3.4.14/json/properties.json create mode 100644 castholm/v0.5.3-3.4.14/json/rect.json create mode 100644 castholm/v0.5.3-3.4.14/json/render.json create mode 100644 castholm/v0.5.3-3.4.14/json/scancode.json create mode 100644 castholm/v0.5.3-3.4.14/json/sensor.json create mode 100644 castholm/v0.5.3-3.4.14/json/storage.json create mode 100644 castholm/v0.5.3-3.4.14/json/surface.json create mode 100644 castholm/v0.5.3-3.4.14/json/system.json create mode 100644 castholm/v0.5.3-3.4.14/json/time.json create mode 100644 castholm/v0.5.3-3.4.14/json/timer.json create mode 100644 castholm/v0.5.3-3.4.14/json/touch.json create mode 100644 castholm/v0.5.3-3.4.14/json/tray.json create mode 100644 castholm/v0.5.3-3.4.14/json/version.json create mode 100644 castholm/v0.5.3-3.4.14/json/video.json create mode 100644 castholm/v0.5.4-3.4.16/api/audio.zig create mode 100644 castholm/v0.5.4-3.4.16/api/blendmode.zig create mode 100644 castholm/v0.5.4-3.4.16/api/c.zig create mode 100644 castholm/v0.5.4-3.4.16/api/camera.zig create mode 100644 castholm/v0.5.4-3.4.16/api/clipboard.zig create mode 100644 castholm/v0.5.4-3.4.16/api/dialog.zig create mode 100644 castholm/v0.5.4-3.4.16/api/endian.zig create mode 100644 castholm/v0.5.4-3.4.16/api/error.zig create mode 100644 castholm/v0.5.4-3.4.16/api/events.zig create mode 100644 castholm/v0.5.4-3.4.16/api/filesystem.zig create mode 100644 castholm/v0.5.4-3.4.16/api/gamepad.zig create mode 100644 castholm/v0.5.4-3.4.16/api/gpu.zig create mode 100644 castholm/v0.5.4-3.4.16/api/guid.zig create mode 100644 castholm/v0.5.4-3.4.16/api/haptic.zig create mode 100644 castholm/v0.5.4-3.4.16/api/hints.zig create mode 100644 castholm/v0.5.4-3.4.16/api/init.zig create mode 100644 castholm/v0.5.4-3.4.16/api/iostream.zig create mode 100644 castholm/v0.5.4-3.4.16/api/joystick.zig create mode 100644 castholm/v0.5.4-3.4.16/api/keyboard.zig create mode 100644 castholm/v0.5.4-3.4.16/api/keycode.zig create mode 100644 castholm/v0.5.4-3.4.16/api/loadso.zig create mode 100644 castholm/v0.5.4-3.4.16/api/messagebox.zig create mode 100644 castholm/v0.5.4-3.4.16/api/misc.zig create mode 100644 castholm/v0.5.4-3.4.16/api/mouse.zig create mode 100644 castholm/v0.5.4-3.4.16/api/opengl.zig create mode 100644 castholm/v0.5.4-3.4.16/api/pen.zig create mode 100644 castholm/v0.5.4-3.4.16/api/pixels.zig create mode 100644 castholm/v0.5.4-3.4.16/api/power.zig create mode 100644 castholm/v0.5.4-3.4.16/api/process.zig create mode 100644 castholm/v0.5.4-3.4.16/api/properties.zig create mode 100644 castholm/v0.5.4-3.4.16/api/rect.zig create mode 100644 castholm/v0.5.4-3.4.16/api/render.zig create mode 100644 castholm/v0.5.4-3.4.16/api/scancode.zig create mode 100644 castholm/v0.5.4-3.4.16/api/sensor.zig create mode 100644 castholm/v0.5.4-3.4.16/api/stdinc.zig create mode 100644 castholm/v0.5.4-3.4.16/api/storage.zig create mode 100644 castholm/v0.5.4-3.4.16/api/surface.zig create mode 100644 castholm/v0.5.4-3.4.16/api/system.zig create mode 100644 castholm/v0.5.4-3.4.16/api/time.zig create mode 100644 castholm/v0.5.4-3.4.16/api/timer.zig create mode 100644 castholm/v0.5.4-3.4.16/api/touch.zig create mode 100644 castholm/v0.5.4-3.4.16/api/tray.zig create mode 100644 castholm/v0.5.4-3.4.16/api/version.zig create mode 100644 castholm/v0.5.4-3.4.16/api/video.zig create mode 100644 castholm/v0.5.4-3.4.16/json/audio.json create mode 100644 castholm/v0.5.4-3.4.16/json/blendmode.json create mode 100644 castholm/v0.5.4-3.4.16/json/camera.json create mode 100644 castholm/v0.5.4-3.4.16/json/clipboard.json create mode 100644 castholm/v0.5.4-3.4.16/json/dialog.json create mode 100644 castholm/v0.5.4-3.4.16/json/endian.json create mode 100644 castholm/v0.5.4-3.4.16/json/error.json create mode 100644 castholm/v0.5.4-3.4.16/json/events.json create mode 100644 castholm/v0.5.4-3.4.16/json/filesystem.json create mode 100644 castholm/v0.5.4-3.4.16/json/gamepad.json create mode 100644 castholm/v0.5.4-3.4.16/json/gpu.json create mode 100644 castholm/v0.5.4-3.4.16/json/guid.json create mode 100644 castholm/v0.5.4-3.4.16/json/haptic.json create mode 100644 castholm/v0.5.4-3.4.16/json/hints.json create mode 100644 castholm/v0.5.4-3.4.16/json/init.json create mode 100644 castholm/v0.5.4-3.4.16/json/iostream.json create mode 100644 castholm/v0.5.4-3.4.16/json/joystick.json create mode 100644 castholm/v0.5.4-3.4.16/json/keyboard.json create mode 100644 castholm/v0.5.4-3.4.16/json/keycode.json create mode 100644 castholm/v0.5.4-3.4.16/json/loadso.json create mode 100644 castholm/v0.5.4-3.4.16/json/messagebox.json create mode 100644 castholm/v0.5.4-3.4.16/json/misc.json create mode 100644 castholm/v0.5.4-3.4.16/json/mouse.json create mode 100644 castholm/v0.5.4-3.4.16/json/opengl.json create mode 100644 castholm/v0.5.4-3.4.16/json/pen.json create mode 100644 castholm/v0.5.4-3.4.16/json/pixels.json create mode 100644 castholm/v0.5.4-3.4.16/json/power.json create mode 100644 castholm/v0.5.4-3.4.16/json/process.json create mode 100644 castholm/v0.5.4-3.4.16/json/properties.json create mode 100644 castholm/v0.5.4-3.4.16/json/rect.json create mode 100644 castholm/v0.5.4-3.4.16/json/render.json create mode 100644 castholm/v0.5.4-3.4.16/json/scancode.json create mode 100644 castholm/v0.5.4-3.4.16/json/sensor.json create mode 100644 castholm/v0.5.4-3.4.16/json/storage.json create mode 100644 castholm/v0.5.4-3.4.16/json/surface.json create mode 100644 castholm/v0.5.4-3.4.16/json/system.json create mode 100644 castholm/v0.5.4-3.4.16/json/time.json create mode 100644 castholm/v0.5.4-3.4.16/json/timer.json create mode 100644 castholm/v0.5.4-3.4.16/json/touch.json create mode 100644 castholm/v0.5.4-3.4.16/json/tray.json create mode 100644 castholm/v0.5.4-3.4.16/json/version.json create mode 100644 castholm/v0.5.4-3.4.16/json/video.json create mode 100644 castholm/v0.6.0-3.4.18/api/audio.zig create mode 100644 castholm/v0.6.0-3.4.18/api/blendmode.zig create mode 100644 castholm/v0.6.0-3.4.18/api/c.zig create mode 100644 castholm/v0.6.0-3.4.18/api/camera.zig create mode 100644 castholm/v0.6.0-3.4.18/api/clipboard.zig create mode 100644 castholm/v0.6.0-3.4.18/api/dialog.zig create mode 100644 castholm/v0.6.0-3.4.18/api/endian.zig create mode 100644 castholm/v0.6.0-3.4.18/api/error.zig create mode 100644 castholm/v0.6.0-3.4.18/api/events.zig create mode 100644 castholm/v0.6.0-3.4.18/api/filesystem.zig create mode 100644 castholm/v0.6.0-3.4.18/api/gamepad.zig create mode 100644 castholm/v0.6.0-3.4.18/api/gpu.zig create mode 100644 castholm/v0.6.0-3.4.18/api/guid.zig create mode 100644 castholm/v0.6.0-3.4.18/api/haptic.zig create mode 100644 castholm/v0.6.0-3.4.18/api/hints.zig create mode 100644 castholm/v0.6.0-3.4.18/api/init.zig create mode 100644 castholm/v0.6.0-3.4.18/api/iostream.zig create mode 100644 castholm/v0.6.0-3.4.18/api/joystick.zig create mode 100644 castholm/v0.6.0-3.4.18/api/keyboard.zig create mode 100644 castholm/v0.6.0-3.4.18/api/keycode.zig create mode 100644 castholm/v0.6.0-3.4.18/api/loadso.zig create mode 100644 castholm/v0.6.0-3.4.18/api/messagebox.zig create mode 100644 castholm/v0.6.0-3.4.18/api/misc.zig create mode 100644 castholm/v0.6.0-3.4.18/api/mouse.zig create mode 100644 castholm/v0.6.0-3.4.18/api/opengl.zig create mode 100644 castholm/v0.6.0-3.4.18/api/pen.zig create mode 100644 castholm/v0.6.0-3.4.18/api/pixels.zig create mode 100644 castholm/v0.6.0-3.4.18/api/power.zig create mode 100644 castholm/v0.6.0-3.4.18/api/process.zig create mode 100644 castholm/v0.6.0-3.4.18/api/properties.zig create mode 100644 castholm/v0.6.0-3.4.18/api/rect.zig create mode 100644 castholm/v0.6.0-3.4.18/api/render.zig create mode 100644 castholm/v0.6.0-3.4.18/api/scancode.zig create mode 100644 castholm/v0.6.0-3.4.18/api/sensor.zig create mode 100644 castholm/v0.6.0-3.4.18/api/stdinc.zig create mode 100644 castholm/v0.6.0-3.4.18/api/storage.zig create mode 100644 castholm/v0.6.0-3.4.18/api/surface.zig create mode 100644 castholm/v0.6.0-3.4.18/api/system.zig create mode 100644 castholm/v0.6.0-3.4.18/api/time.zig create mode 100644 castholm/v0.6.0-3.4.18/api/timer.zig create mode 100644 castholm/v0.6.0-3.4.18/api/touch.zig create mode 100644 castholm/v0.6.0-3.4.18/api/tray.zig create mode 100644 castholm/v0.6.0-3.4.18/api/version.zig create mode 100644 castholm/v0.6.0-3.4.18/api/video.zig create mode 100644 castholm/v0.6.0-3.4.18/json/audio.json create mode 100644 castholm/v0.6.0-3.4.18/json/blendmode.json create mode 100644 castholm/v0.6.0-3.4.18/json/camera.json create mode 100644 castholm/v0.6.0-3.4.18/json/clipboard.json create mode 100644 castholm/v0.6.0-3.4.18/json/dialog.json create mode 100644 castholm/v0.6.0-3.4.18/json/endian.json create mode 100644 castholm/v0.6.0-3.4.18/json/error.json create mode 100644 castholm/v0.6.0-3.4.18/json/events.json create mode 100644 castholm/v0.6.0-3.4.18/json/filesystem.json create mode 100644 castholm/v0.6.0-3.4.18/json/gamepad.json create mode 100644 castholm/v0.6.0-3.4.18/json/gpu.json create mode 100644 castholm/v0.6.0-3.4.18/json/guid.json create mode 100644 castholm/v0.6.0-3.4.18/json/haptic.json create mode 100644 castholm/v0.6.0-3.4.18/json/hints.json create mode 100644 castholm/v0.6.0-3.4.18/json/init.json create mode 100644 castholm/v0.6.0-3.4.18/json/iostream.json create mode 100644 castholm/v0.6.0-3.4.18/json/joystick.json create mode 100644 castholm/v0.6.0-3.4.18/json/keyboard.json create mode 100644 castholm/v0.6.0-3.4.18/json/keycode.json create mode 100644 castholm/v0.6.0-3.4.18/json/loadso.json create mode 100644 castholm/v0.6.0-3.4.18/json/messagebox.json create mode 100644 castholm/v0.6.0-3.4.18/json/misc.json create mode 100644 castholm/v0.6.0-3.4.18/json/mouse.json create mode 100644 castholm/v0.6.0-3.4.18/json/opengl.json create mode 100644 castholm/v0.6.0-3.4.18/json/pen.json create mode 100644 castholm/v0.6.0-3.4.18/json/pixels.json create mode 100644 castholm/v0.6.0-3.4.18/json/power.json create mode 100644 castholm/v0.6.0-3.4.18/json/process.json create mode 100644 castholm/v0.6.0-3.4.18/json/properties.json create mode 100644 castholm/v0.6.0-3.4.18/json/rect.json create mode 100644 castholm/v0.6.0-3.4.18/json/render.json create mode 100644 castholm/v0.6.0-3.4.18/json/scancode.json create mode 100644 castholm/v0.6.0-3.4.18/json/sensor.json create mode 100644 castholm/v0.6.0-3.4.18/json/storage.json create mode 100644 castholm/v0.6.0-3.4.18/json/surface.json create mode 100644 castholm/v0.6.0-3.4.18/json/system.json create mode 100644 castholm/v0.6.0-3.4.18/json/time.json create mode 100644 castholm/v0.6.0-3.4.18/json/timer.json create mode 100644 castholm/v0.6.0-3.4.18/json/touch.json create mode 100644 castholm/v0.6.0-3.4.18/json/tray.json create mode 100644 castholm/v0.6.0-3.4.18/json/version.json create mode 100644 castholm/v0.6.0-3.4.18/json/video.json create mode 100644 castholm/v0.6.1-3.4.20/api/audio.zig create mode 100644 castholm/v0.6.1-3.4.20/api/blendmode.zig create mode 100644 castholm/v0.6.1-3.4.20/api/c.zig create mode 100644 castholm/v0.6.1-3.4.20/api/camera.zig create mode 100644 castholm/v0.6.1-3.4.20/api/clipboard.zig create mode 100644 castholm/v0.6.1-3.4.20/api/dialog.zig create mode 100644 castholm/v0.6.1-3.4.20/api/endian.zig create mode 100644 castholm/v0.6.1-3.4.20/api/error.zig create mode 100644 castholm/v0.6.1-3.4.20/api/events.zig create mode 100644 castholm/v0.6.1-3.4.20/api/filesystem.zig create mode 100644 castholm/v0.6.1-3.4.20/api/gamepad.zig create mode 100644 castholm/v0.6.1-3.4.20/api/gpu.zig create mode 100644 castholm/v0.6.1-3.4.20/api/guid.zig create mode 100644 castholm/v0.6.1-3.4.20/api/haptic.zig create mode 100644 castholm/v0.6.1-3.4.20/api/hints.zig create mode 100644 castholm/v0.6.1-3.4.20/api/init.zig create mode 100644 castholm/v0.6.1-3.4.20/api/iostream.zig create mode 100644 castholm/v0.6.1-3.4.20/api/joystick.zig create mode 100644 castholm/v0.6.1-3.4.20/api/keyboard.zig create mode 100644 castholm/v0.6.1-3.4.20/api/keycode.zig create mode 100644 castholm/v0.6.1-3.4.20/api/loadso.zig create mode 100644 castholm/v0.6.1-3.4.20/api/messagebox.zig create mode 100644 castholm/v0.6.1-3.4.20/api/misc.zig create mode 100644 castholm/v0.6.1-3.4.20/api/mouse.zig create mode 100644 castholm/v0.6.1-3.4.20/api/opengl.zig create mode 100644 castholm/v0.6.1-3.4.20/api/pen.zig create mode 100644 castholm/v0.6.1-3.4.20/api/pixels.zig create mode 100644 castholm/v0.6.1-3.4.20/api/power.zig create mode 100644 castholm/v0.6.1-3.4.20/api/process.zig create mode 100644 castholm/v0.6.1-3.4.20/api/properties.zig create mode 100644 castholm/v0.6.1-3.4.20/api/rect.zig create mode 100644 castholm/v0.6.1-3.4.20/api/render.zig create mode 100644 castholm/v0.6.1-3.4.20/api/scancode.zig create mode 100644 castholm/v0.6.1-3.4.20/api/sensor.zig create mode 100644 castholm/v0.6.1-3.4.20/api/stdinc.zig create mode 100644 castholm/v0.6.1-3.4.20/api/storage.zig create mode 100644 castholm/v0.6.1-3.4.20/api/surface.zig create mode 100644 castholm/v0.6.1-3.4.20/api/system.zig create mode 100644 castholm/v0.6.1-3.4.20/api/time.zig create mode 100644 castholm/v0.6.1-3.4.20/api/timer.zig create mode 100644 castholm/v0.6.1-3.4.20/api/touch.zig create mode 100644 castholm/v0.6.1-3.4.20/api/tray.zig create mode 100644 castholm/v0.6.1-3.4.20/api/version.zig create mode 100644 castholm/v0.6.1-3.4.20/api/video.zig create mode 100644 castholm/v0.6.1-3.4.20/json/audio.json create mode 100644 castholm/v0.6.1-3.4.20/json/blendmode.json create mode 100644 castholm/v0.6.1-3.4.20/json/camera.json create mode 100644 castholm/v0.6.1-3.4.20/json/clipboard.json create mode 100644 castholm/v0.6.1-3.4.20/json/dialog.json create mode 100644 castholm/v0.6.1-3.4.20/json/endian.json create mode 100644 castholm/v0.6.1-3.4.20/json/error.json create mode 100644 castholm/v0.6.1-3.4.20/json/events.json create mode 100644 castholm/v0.6.1-3.4.20/json/filesystem.json create mode 100644 castholm/v0.6.1-3.4.20/json/gamepad.json create mode 100644 castholm/v0.6.1-3.4.20/json/gpu.json create mode 100644 castholm/v0.6.1-3.4.20/json/guid.json create mode 100644 castholm/v0.6.1-3.4.20/json/haptic.json create mode 100644 castholm/v0.6.1-3.4.20/json/hints.json create mode 100644 castholm/v0.6.1-3.4.20/json/init.json create mode 100644 castholm/v0.6.1-3.4.20/json/iostream.json create mode 100644 castholm/v0.6.1-3.4.20/json/joystick.json create mode 100644 castholm/v0.6.1-3.4.20/json/keyboard.json create mode 100644 castholm/v0.6.1-3.4.20/json/keycode.json create mode 100644 castholm/v0.6.1-3.4.20/json/loadso.json create mode 100644 castholm/v0.6.1-3.4.20/json/messagebox.json create mode 100644 castholm/v0.6.1-3.4.20/json/misc.json create mode 100644 castholm/v0.6.1-3.4.20/json/mouse.json create mode 100644 castholm/v0.6.1-3.4.20/json/opengl.json create mode 100644 castholm/v0.6.1-3.4.20/json/pen.json create mode 100644 castholm/v0.6.1-3.4.20/json/pixels.json create mode 100644 castholm/v0.6.1-3.4.20/json/power.json create mode 100644 castholm/v0.6.1-3.4.20/json/process.json create mode 100644 castholm/v0.6.1-3.4.20/json/properties.json create mode 100644 castholm/v0.6.1-3.4.20/json/rect.json create mode 100644 castholm/v0.6.1-3.4.20/json/render.json create mode 100644 castholm/v0.6.1-3.4.20/json/scancode.json create mode 100644 castholm/v0.6.1-3.4.20/json/sensor.json create mode 100644 castholm/v0.6.1-3.4.20/json/storage.json create mode 100644 castholm/v0.6.1-3.4.20/json/surface.json create mode 100644 castholm/v0.6.1-3.4.20/json/system.json create mode 100644 castholm/v0.6.1-3.4.20/json/time.json create mode 100644 castholm/v0.6.1-3.4.20/json/timer.json create mode 100644 castholm/v0.6.1-3.4.20/json/touch.json create mode 100644 castholm/v0.6.1-3.4.20/json/tray.json create mode 100644 castholm/v0.6.1-3.4.20/json/version.json create mode 100644 castholm/v0.6.1-3.4.20/json/video.json create mode 100644 official/release-3.4.10/api/audio.zig create mode 100644 official/release-3.4.10/api/blendmode.zig create mode 100644 official/release-3.4.10/api/c.zig create mode 100644 official/release-3.4.10/api/camera.zig create mode 100644 official/release-3.4.10/api/clipboard.zig create mode 100644 official/release-3.4.10/api/dialog.zig create mode 100644 official/release-3.4.10/api/endian.zig create mode 100644 official/release-3.4.10/api/error.zig create mode 100644 official/release-3.4.10/api/events.zig create mode 100644 official/release-3.4.10/api/filesystem.zig create mode 100644 official/release-3.4.10/api/gamepad.zig create mode 100644 official/release-3.4.10/api/gpu.zig create mode 100644 official/release-3.4.10/api/guid.zig create mode 100644 official/release-3.4.10/api/haptic.zig create mode 100644 official/release-3.4.10/api/hints.zig create mode 100644 official/release-3.4.10/api/init.zig create mode 100644 official/release-3.4.10/api/iostream.zig create mode 100644 official/release-3.4.10/api/joystick.zig create mode 100644 official/release-3.4.10/api/keyboard.zig create mode 100644 official/release-3.4.10/api/keycode.zig create mode 100644 official/release-3.4.10/api/loadso.zig create mode 100644 official/release-3.4.10/api/messagebox.zig create mode 100644 official/release-3.4.10/api/misc.zig create mode 100644 official/release-3.4.10/api/mouse.zig create mode 100644 official/release-3.4.10/api/opengl.zig create mode 100644 official/release-3.4.10/api/pen.zig create mode 100644 official/release-3.4.10/api/pixels.zig create mode 100644 official/release-3.4.10/api/power.zig create mode 100644 official/release-3.4.10/api/process.zig create mode 100644 official/release-3.4.10/api/properties.zig create mode 100644 official/release-3.4.10/api/rect.zig create mode 100644 official/release-3.4.10/api/render.zig create mode 100644 official/release-3.4.10/api/scancode.zig create mode 100644 official/release-3.4.10/api/sensor.zig create mode 100644 official/release-3.4.10/api/stdinc.zig create mode 100644 official/release-3.4.10/api/storage.zig create mode 100644 official/release-3.4.10/api/surface.zig create mode 100644 official/release-3.4.10/api/system.zig create mode 100644 official/release-3.4.10/api/time.zig create mode 100644 official/release-3.4.10/api/timer.zig create mode 100644 official/release-3.4.10/api/touch.zig create mode 100644 official/release-3.4.10/api/tray.zig create mode 100644 official/release-3.4.10/api/version.zig create mode 100644 official/release-3.4.10/api/video.zig create mode 100644 official/release-3.4.10/json/audio.json create mode 100644 official/release-3.4.10/json/blendmode.json create mode 100644 official/release-3.4.10/json/camera.json create mode 100644 official/release-3.4.10/json/clipboard.json create mode 100644 official/release-3.4.10/json/dialog.json create mode 100644 official/release-3.4.10/json/endian.json create mode 100644 official/release-3.4.10/json/error.json create mode 100644 official/release-3.4.10/json/events.json create mode 100644 official/release-3.4.10/json/filesystem.json create mode 100644 official/release-3.4.10/json/gamepad.json create mode 100644 official/release-3.4.10/json/gpu.json create mode 100644 official/release-3.4.10/json/guid.json create mode 100644 official/release-3.4.10/json/haptic.json create mode 100644 official/release-3.4.10/json/hints.json create mode 100644 official/release-3.4.10/json/init.json create mode 100644 official/release-3.4.10/json/iostream.json create mode 100644 official/release-3.4.10/json/joystick.json create mode 100644 official/release-3.4.10/json/keyboard.json create mode 100644 official/release-3.4.10/json/keycode.json create mode 100644 official/release-3.4.10/json/loadso.json create mode 100644 official/release-3.4.10/json/messagebox.json create mode 100644 official/release-3.4.10/json/misc.json create mode 100644 official/release-3.4.10/json/mouse.json create mode 100644 official/release-3.4.10/json/opengl.json create mode 100644 official/release-3.4.10/json/pen.json create mode 100644 official/release-3.4.10/json/pixels.json create mode 100644 official/release-3.4.10/json/power.json create mode 100644 official/release-3.4.10/json/process.json create mode 100644 official/release-3.4.10/json/properties.json create mode 100644 official/release-3.4.10/json/rect.json create mode 100644 official/release-3.4.10/json/render.json create mode 100644 official/release-3.4.10/json/scancode.json create mode 100644 official/release-3.4.10/json/sensor.json create mode 100644 official/release-3.4.10/json/storage.json create mode 100644 official/release-3.4.10/json/surface.json create mode 100644 official/release-3.4.10/json/system.json create mode 100644 official/release-3.4.10/json/time.json create mode 100644 official/release-3.4.10/json/timer.json create mode 100644 official/release-3.4.10/json/touch.json create mode 100644 official/release-3.4.10/json/tray.json create mode 100644 official/release-3.4.10/json/version.json create mode 100644 official/release-3.4.10/json/video.json create mode 100644 official/release-3.4.12/api/audio.zig create mode 100644 official/release-3.4.12/api/blendmode.zig create mode 100644 official/release-3.4.12/api/c.zig create mode 100644 official/release-3.4.12/api/camera.zig create mode 100644 official/release-3.4.12/api/clipboard.zig create mode 100644 official/release-3.4.12/api/dialog.zig create mode 100644 official/release-3.4.12/api/endian.zig create mode 100644 official/release-3.4.12/api/error.zig create mode 100644 official/release-3.4.12/api/events.zig create mode 100644 official/release-3.4.12/api/filesystem.zig create mode 100644 official/release-3.4.12/api/gamepad.zig create mode 100644 official/release-3.4.12/api/gpu.zig create mode 100644 official/release-3.4.12/api/guid.zig create mode 100644 official/release-3.4.12/api/haptic.zig create mode 100644 official/release-3.4.12/api/hints.zig create mode 100644 official/release-3.4.12/api/init.zig create mode 100644 official/release-3.4.12/api/iostream.zig create mode 100644 official/release-3.4.12/api/joystick.zig create mode 100644 official/release-3.4.12/api/keyboard.zig create mode 100644 official/release-3.4.12/api/keycode.zig create mode 100644 official/release-3.4.12/api/loadso.zig create mode 100644 official/release-3.4.12/api/messagebox.zig create mode 100644 official/release-3.4.12/api/misc.zig create mode 100644 official/release-3.4.12/api/mouse.zig create mode 100644 official/release-3.4.12/api/opengl.zig create mode 100644 official/release-3.4.12/api/pen.zig create mode 100644 official/release-3.4.12/api/pixels.zig create mode 100644 official/release-3.4.12/api/power.zig create mode 100644 official/release-3.4.12/api/process.zig create mode 100644 official/release-3.4.12/api/properties.zig create mode 100644 official/release-3.4.12/api/rect.zig create mode 100644 official/release-3.4.12/api/render.zig create mode 100644 official/release-3.4.12/api/scancode.zig create mode 100644 official/release-3.4.12/api/sensor.zig create mode 100644 official/release-3.4.12/api/stdinc.zig create mode 100644 official/release-3.4.12/api/storage.zig create mode 100644 official/release-3.4.12/api/surface.zig create mode 100644 official/release-3.4.12/api/system.zig create mode 100644 official/release-3.4.12/api/time.zig create mode 100644 official/release-3.4.12/api/timer.zig create mode 100644 official/release-3.4.12/api/touch.zig create mode 100644 official/release-3.4.12/api/tray.zig create mode 100644 official/release-3.4.12/api/version.zig create mode 100644 official/release-3.4.12/api/video.zig create mode 100644 official/release-3.4.12/json/audio.json create mode 100644 official/release-3.4.12/json/blendmode.json create mode 100644 official/release-3.4.12/json/camera.json create mode 100644 official/release-3.4.12/json/clipboard.json create mode 100644 official/release-3.4.12/json/dialog.json create mode 100644 official/release-3.4.12/json/endian.json create mode 100644 official/release-3.4.12/json/error.json create mode 100644 official/release-3.4.12/json/events.json create mode 100644 official/release-3.4.12/json/filesystem.json create mode 100644 official/release-3.4.12/json/gamepad.json create mode 100644 official/release-3.4.12/json/gpu.json create mode 100644 official/release-3.4.12/json/guid.json create mode 100644 official/release-3.4.12/json/haptic.json create mode 100644 official/release-3.4.12/json/hints.json create mode 100644 official/release-3.4.12/json/init.json create mode 100644 official/release-3.4.12/json/iostream.json create mode 100644 official/release-3.4.12/json/joystick.json create mode 100644 official/release-3.4.12/json/keyboard.json create mode 100644 official/release-3.4.12/json/keycode.json create mode 100644 official/release-3.4.12/json/loadso.json create mode 100644 official/release-3.4.12/json/messagebox.json create mode 100644 official/release-3.4.12/json/misc.json create mode 100644 official/release-3.4.12/json/mouse.json create mode 100644 official/release-3.4.12/json/opengl.json create mode 100644 official/release-3.4.12/json/pen.json create mode 100644 official/release-3.4.12/json/pixels.json create mode 100644 official/release-3.4.12/json/power.json create mode 100644 official/release-3.4.12/json/process.json create mode 100644 official/release-3.4.12/json/properties.json create mode 100644 official/release-3.4.12/json/rect.json create mode 100644 official/release-3.4.12/json/render.json create mode 100644 official/release-3.4.12/json/scancode.json create mode 100644 official/release-3.4.12/json/sensor.json create mode 100644 official/release-3.4.12/json/storage.json create mode 100644 official/release-3.4.12/json/surface.json create mode 100644 official/release-3.4.12/json/system.json create mode 100644 official/release-3.4.12/json/time.json create mode 100644 official/release-3.4.12/json/timer.json create mode 100644 official/release-3.4.12/json/touch.json create mode 100644 official/release-3.4.12/json/tray.json create mode 100644 official/release-3.4.12/json/version.json create mode 100644 official/release-3.4.12/json/video.json create mode 100644 official/release-3.4.14/api/audio.zig create mode 100644 official/release-3.4.14/api/blendmode.zig create mode 100644 official/release-3.4.14/api/c.zig create mode 100644 official/release-3.4.14/api/camera.zig create mode 100644 official/release-3.4.14/api/clipboard.zig create mode 100644 official/release-3.4.14/api/dialog.zig create mode 100644 official/release-3.4.14/api/endian.zig create mode 100644 official/release-3.4.14/api/error.zig create mode 100644 official/release-3.4.14/api/events.zig create mode 100644 official/release-3.4.14/api/filesystem.zig create mode 100644 official/release-3.4.14/api/gamepad.zig create mode 100644 official/release-3.4.14/api/gpu.zig create mode 100644 official/release-3.4.14/api/guid.zig create mode 100644 official/release-3.4.14/api/haptic.zig create mode 100644 official/release-3.4.14/api/hints.zig create mode 100644 official/release-3.4.14/api/init.zig create mode 100644 official/release-3.4.14/api/iostream.zig create mode 100644 official/release-3.4.14/api/joystick.zig create mode 100644 official/release-3.4.14/api/keyboard.zig create mode 100644 official/release-3.4.14/api/keycode.zig create mode 100644 official/release-3.4.14/api/loadso.zig create mode 100644 official/release-3.4.14/api/messagebox.zig create mode 100644 official/release-3.4.14/api/misc.zig create mode 100644 official/release-3.4.14/api/mouse.zig create mode 100644 official/release-3.4.14/api/opengl.zig create mode 100644 official/release-3.4.14/api/pen.zig create mode 100644 official/release-3.4.14/api/pixels.zig create mode 100644 official/release-3.4.14/api/power.zig create mode 100644 official/release-3.4.14/api/process.zig create mode 100644 official/release-3.4.14/api/properties.zig create mode 100644 official/release-3.4.14/api/rect.zig create mode 100644 official/release-3.4.14/api/render.zig create mode 100644 official/release-3.4.14/api/scancode.zig create mode 100644 official/release-3.4.14/api/sensor.zig create mode 100644 official/release-3.4.14/api/stdinc.zig create mode 100644 official/release-3.4.14/api/storage.zig create mode 100644 official/release-3.4.14/api/surface.zig create mode 100644 official/release-3.4.14/api/system.zig create mode 100644 official/release-3.4.14/api/time.zig create mode 100644 official/release-3.4.14/api/timer.zig create mode 100644 official/release-3.4.14/api/touch.zig create mode 100644 official/release-3.4.14/api/tray.zig create mode 100644 official/release-3.4.14/api/version.zig create mode 100644 official/release-3.4.14/api/video.zig create mode 100644 official/release-3.4.14/json/audio.json create mode 100644 official/release-3.4.14/json/blendmode.json create mode 100644 official/release-3.4.14/json/camera.json create mode 100644 official/release-3.4.14/json/clipboard.json create mode 100644 official/release-3.4.14/json/dialog.json create mode 100644 official/release-3.4.14/json/endian.json create mode 100644 official/release-3.4.14/json/error.json create mode 100644 official/release-3.4.14/json/events.json create mode 100644 official/release-3.4.14/json/filesystem.json create mode 100644 official/release-3.4.14/json/gamepad.json create mode 100644 official/release-3.4.14/json/gpu.json create mode 100644 official/release-3.4.14/json/guid.json create mode 100644 official/release-3.4.14/json/haptic.json create mode 100644 official/release-3.4.14/json/hints.json create mode 100644 official/release-3.4.14/json/init.json create mode 100644 official/release-3.4.14/json/iostream.json create mode 100644 official/release-3.4.14/json/joystick.json create mode 100644 official/release-3.4.14/json/keyboard.json create mode 100644 official/release-3.4.14/json/keycode.json create mode 100644 official/release-3.4.14/json/loadso.json create mode 100644 official/release-3.4.14/json/messagebox.json create mode 100644 official/release-3.4.14/json/misc.json create mode 100644 official/release-3.4.14/json/mouse.json create mode 100644 official/release-3.4.14/json/opengl.json create mode 100644 official/release-3.4.14/json/pen.json create mode 100644 official/release-3.4.14/json/pixels.json create mode 100644 official/release-3.4.14/json/power.json create mode 100644 official/release-3.4.14/json/process.json create mode 100644 official/release-3.4.14/json/properties.json create mode 100644 official/release-3.4.14/json/rect.json create mode 100644 official/release-3.4.14/json/render.json create mode 100644 official/release-3.4.14/json/scancode.json create mode 100644 official/release-3.4.14/json/sensor.json create mode 100644 official/release-3.4.14/json/storage.json create mode 100644 official/release-3.4.14/json/surface.json create mode 100644 official/release-3.4.14/json/system.json create mode 100644 official/release-3.4.14/json/time.json create mode 100644 official/release-3.4.14/json/timer.json create mode 100644 official/release-3.4.14/json/touch.json create mode 100644 official/release-3.4.14/json/tray.json create mode 100644 official/release-3.4.14/json/version.json create mode 100644 official/release-3.4.14/json/video.json create mode 100644 official/release-3.4.16/api/audio.zig create mode 100644 official/release-3.4.16/api/blendmode.zig create mode 100644 official/release-3.4.16/api/c.zig create mode 100644 official/release-3.4.16/api/camera.zig create mode 100644 official/release-3.4.16/api/clipboard.zig create mode 100644 official/release-3.4.16/api/dialog.zig create mode 100644 official/release-3.4.16/api/endian.zig create mode 100644 official/release-3.4.16/api/error.zig create mode 100644 official/release-3.4.16/api/events.zig create mode 100644 official/release-3.4.16/api/filesystem.zig create mode 100644 official/release-3.4.16/api/gamepad.zig create mode 100644 official/release-3.4.16/api/gpu.zig create mode 100644 official/release-3.4.16/api/guid.zig create mode 100644 official/release-3.4.16/api/haptic.zig create mode 100644 official/release-3.4.16/api/hints.zig create mode 100644 official/release-3.4.16/api/init.zig create mode 100644 official/release-3.4.16/api/iostream.zig create mode 100644 official/release-3.4.16/api/joystick.zig create mode 100644 official/release-3.4.16/api/keyboard.zig create mode 100644 official/release-3.4.16/api/keycode.zig create mode 100644 official/release-3.4.16/api/loadso.zig create mode 100644 official/release-3.4.16/api/messagebox.zig create mode 100644 official/release-3.4.16/api/misc.zig create mode 100644 official/release-3.4.16/api/mouse.zig create mode 100644 official/release-3.4.16/api/opengl.zig create mode 100644 official/release-3.4.16/api/pen.zig create mode 100644 official/release-3.4.16/api/pixels.zig create mode 100644 official/release-3.4.16/api/power.zig create mode 100644 official/release-3.4.16/api/process.zig create mode 100644 official/release-3.4.16/api/properties.zig create mode 100644 official/release-3.4.16/api/rect.zig create mode 100644 official/release-3.4.16/api/render.zig create mode 100644 official/release-3.4.16/api/scancode.zig create mode 100644 official/release-3.4.16/api/sensor.zig create mode 100644 official/release-3.4.16/api/stdinc.zig create mode 100644 official/release-3.4.16/api/storage.zig create mode 100644 official/release-3.4.16/api/surface.zig create mode 100644 official/release-3.4.16/api/system.zig create mode 100644 official/release-3.4.16/api/time.zig create mode 100644 official/release-3.4.16/api/timer.zig create mode 100644 official/release-3.4.16/api/touch.zig create mode 100644 official/release-3.4.16/api/tray.zig create mode 100644 official/release-3.4.16/api/version.zig create mode 100644 official/release-3.4.16/api/video.zig create mode 100644 official/release-3.4.16/json/audio.json create mode 100644 official/release-3.4.16/json/blendmode.json create mode 100644 official/release-3.4.16/json/camera.json create mode 100644 official/release-3.4.16/json/clipboard.json create mode 100644 official/release-3.4.16/json/dialog.json create mode 100644 official/release-3.4.16/json/endian.json create mode 100644 official/release-3.4.16/json/error.json create mode 100644 official/release-3.4.16/json/events.json create mode 100644 official/release-3.4.16/json/filesystem.json create mode 100644 official/release-3.4.16/json/gamepad.json create mode 100644 official/release-3.4.16/json/gpu.json create mode 100644 official/release-3.4.16/json/guid.json create mode 100644 official/release-3.4.16/json/haptic.json create mode 100644 official/release-3.4.16/json/hints.json create mode 100644 official/release-3.4.16/json/init.json create mode 100644 official/release-3.4.16/json/iostream.json create mode 100644 official/release-3.4.16/json/joystick.json create mode 100644 official/release-3.4.16/json/keyboard.json create mode 100644 official/release-3.4.16/json/keycode.json create mode 100644 official/release-3.4.16/json/loadso.json create mode 100644 official/release-3.4.16/json/messagebox.json create mode 100644 official/release-3.4.16/json/misc.json create mode 100644 official/release-3.4.16/json/mouse.json create mode 100644 official/release-3.4.16/json/opengl.json create mode 100644 official/release-3.4.16/json/pen.json create mode 100644 official/release-3.4.16/json/pixels.json create mode 100644 official/release-3.4.16/json/power.json create mode 100644 official/release-3.4.16/json/process.json create mode 100644 official/release-3.4.16/json/properties.json create mode 100644 official/release-3.4.16/json/rect.json create mode 100644 official/release-3.4.16/json/render.json create mode 100644 official/release-3.4.16/json/scancode.json create mode 100644 official/release-3.4.16/json/sensor.json create mode 100644 official/release-3.4.16/json/storage.json create mode 100644 official/release-3.4.16/json/surface.json create mode 100644 official/release-3.4.16/json/system.json create mode 100644 official/release-3.4.16/json/time.json create mode 100644 official/release-3.4.16/json/timer.json create mode 100644 official/release-3.4.16/json/touch.json create mode 100644 official/release-3.4.16/json/tray.json create mode 100644 official/release-3.4.16/json/version.json create mode 100644 official/release-3.4.16/json/video.json create mode 100644 official/release-3.4.18/api/audio.zig create mode 100644 official/release-3.4.18/api/blendmode.zig create mode 100644 official/release-3.4.18/api/c.zig create mode 100644 official/release-3.4.18/api/camera.zig create mode 100644 official/release-3.4.18/api/clipboard.zig create mode 100644 official/release-3.4.18/api/dialog.zig create mode 100644 official/release-3.4.18/api/endian.zig create mode 100644 official/release-3.4.18/api/error.zig create mode 100644 official/release-3.4.18/api/events.zig create mode 100644 official/release-3.4.18/api/filesystem.zig create mode 100644 official/release-3.4.18/api/gamepad.zig create mode 100644 official/release-3.4.18/api/gpu.zig create mode 100644 official/release-3.4.18/api/guid.zig create mode 100644 official/release-3.4.18/api/haptic.zig create mode 100644 official/release-3.4.18/api/hints.zig create mode 100644 official/release-3.4.18/api/init.zig create mode 100644 official/release-3.4.18/api/iostream.zig create mode 100644 official/release-3.4.18/api/joystick.zig create mode 100644 official/release-3.4.18/api/keyboard.zig create mode 100644 official/release-3.4.18/api/keycode.zig create mode 100644 official/release-3.4.18/api/loadso.zig create mode 100644 official/release-3.4.18/api/messagebox.zig create mode 100644 official/release-3.4.18/api/misc.zig create mode 100644 official/release-3.4.18/api/mouse.zig create mode 100644 official/release-3.4.18/api/opengl.zig create mode 100644 official/release-3.4.18/api/pen.zig create mode 100644 official/release-3.4.18/api/pixels.zig create mode 100644 official/release-3.4.18/api/power.zig create mode 100644 official/release-3.4.18/api/process.zig create mode 100644 official/release-3.4.18/api/properties.zig create mode 100644 official/release-3.4.18/api/rect.zig create mode 100644 official/release-3.4.18/api/render.zig create mode 100644 official/release-3.4.18/api/scancode.zig create mode 100644 official/release-3.4.18/api/sensor.zig create mode 100644 official/release-3.4.18/api/stdinc.zig create mode 100644 official/release-3.4.18/api/storage.zig create mode 100644 official/release-3.4.18/api/surface.zig create mode 100644 official/release-3.4.18/api/system.zig create mode 100644 official/release-3.4.18/api/time.zig create mode 100644 official/release-3.4.18/api/timer.zig create mode 100644 official/release-3.4.18/api/touch.zig create mode 100644 official/release-3.4.18/api/tray.zig create mode 100644 official/release-3.4.18/api/version.zig create mode 100644 official/release-3.4.18/api/video.zig create mode 100644 official/release-3.4.18/json/audio.json create mode 100644 official/release-3.4.18/json/blendmode.json create mode 100644 official/release-3.4.18/json/camera.json create mode 100644 official/release-3.4.18/json/clipboard.json create mode 100644 official/release-3.4.18/json/dialog.json create mode 100644 official/release-3.4.18/json/endian.json create mode 100644 official/release-3.4.18/json/error.json create mode 100644 official/release-3.4.18/json/events.json create mode 100644 official/release-3.4.18/json/filesystem.json create mode 100644 official/release-3.4.18/json/gamepad.json create mode 100644 official/release-3.4.18/json/gpu.json create mode 100644 official/release-3.4.18/json/guid.json create mode 100644 official/release-3.4.18/json/haptic.json create mode 100644 official/release-3.4.18/json/hints.json create mode 100644 official/release-3.4.18/json/init.json create mode 100644 official/release-3.4.18/json/iostream.json create mode 100644 official/release-3.4.18/json/joystick.json create mode 100644 official/release-3.4.18/json/keyboard.json create mode 100644 official/release-3.4.18/json/keycode.json create mode 100644 official/release-3.4.18/json/loadso.json create mode 100644 official/release-3.4.18/json/messagebox.json create mode 100644 official/release-3.4.18/json/misc.json create mode 100644 official/release-3.4.18/json/mouse.json create mode 100644 official/release-3.4.18/json/opengl.json create mode 100644 official/release-3.4.18/json/pen.json create mode 100644 official/release-3.4.18/json/pixels.json create mode 100644 official/release-3.4.18/json/power.json create mode 100644 official/release-3.4.18/json/process.json create mode 100644 official/release-3.4.18/json/properties.json create mode 100644 official/release-3.4.18/json/rect.json create mode 100644 official/release-3.4.18/json/render.json create mode 100644 official/release-3.4.18/json/scancode.json create mode 100644 official/release-3.4.18/json/sensor.json create mode 100644 official/release-3.4.18/json/storage.json create mode 100644 official/release-3.4.18/json/surface.json create mode 100644 official/release-3.4.18/json/system.json create mode 100644 official/release-3.4.18/json/time.json create mode 100644 official/release-3.4.18/json/timer.json create mode 100644 official/release-3.4.18/json/touch.json create mode 100644 official/release-3.4.18/json/tray.json create mode 100644 official/release-3.4.18/json/version.json create mode 100644 official/release-3.4.18/json/video.json create mode 100644 official/release-3.4.2/api/audio.zig create mode 100644 official/release-3.4.2/api/blendmode.zig create mode 100644 official/release-3.4.2/api/c.zig create mode 100644 official/release-3.4.2/api/camera.zig create mode 100644 official/release-3.4.2/api/clipboard.zig create mode 100644 official/release-3.4.2/api/dialog.zig create mode 100644 official/release-3.4.2/api/endian.zig create mode 100644 official/release-3.4.2/api/error.zig create mode 100644 official/release-3.4.2/api/events.zig create mode 100644 official/release-3.4.2/api/filesystem.zig create mode 100644 official/release-3.4.2/api/gamepad.zig create mode 100644 official/release-3.4.2/api/gpu.zig create mode 100644 official/release-3.4.2/api/guid.zig create mode 100644 official/release-3.4.2/api/haptic.zig create mode 100644 official/release-3.4.2/api/hints.zig create mode 100644 official/release-3.4.2/api/init.zig create mode 100644 official/release-3.4.2/api/iostream.zig create mode 100644 official/release-3.4.2/api/joystick.zig create mode 100644 official/release-3.4.2/api/keyboard.zig create mode 100644 official/release-3.4.2/api/keycode.zig create mode 100644 official/release-3.4.2/api/loadso.zig create mode 100644 official/release-3.4.2/api/messagebox.zig create mode 100644 official/release-3.4.2/api/misc.zig create mode 100644 official/release-3.4.2/api/mouse.zig create mode 100644 official/release-3.4.2/api/opengl.zig create mode 100644 official/release-3.4.2/api/pen.zig create mode 100644 official/release-3.4.2/api/pixels.zig create mode 100644 official/release-3.4.2/api/power.zig create mode 100644 official/release-3.4.2/api/process.zig create mode 100644 official/release-3.4.2/api/properties.zig create mode 100644 official/release-3.4.2/api/rect.zig create mode 100644 official/release-3.4.2/api/render.zig create mode 100644 official/release-3.4.2/api/scancode.zig create mode 100644 official/release-3.4.2/api/sensor.zig create mode 100644 official/release-3.4.2/api/stdinc.zig create mode 100644 official/release-3.4.2/api/storage.zig create mode 100644 official/release-3.4.2/api/surface.zig create mode 100644 official/release-3.4.2/api/system.zig create mode 100644 official/release-3.4.2/api/time.zig create mode 100644 official/release-3.4.2/api/timer.zig create mode 100644 official/release-3.4.2/api/touch.zig create mode 100644 official/release-3.4.2/api/tray.zig create mode 100644 official/release-3.4.2/api/version.zig create mode 100644 official/release-3.4.2/api/video.zig create mode 100644 official/release-3.4.2/json/audio.json create mode 100644 official/release-3.4.2/json/blendmode.json create mode 100644 official/release-3.4.2/json/camera.json create mode 100644 official/release-3.4.2/json/clipboard.json create mode 100644 official/release-3.4.2/json/dialog.json create mode 100644 official/release-3.4.2/json/endian.json create mode 100644 official/release-3.4.2/json/error.json create mode 100644 official/release-3.4.2/json/events.json create mode 100644 official/release-3.4.2/json/filesystem.json create mode 100644 official/release-3.4.2/json/gamepad.json create mode 100644 official/release-3.4.2/json/gpu.json create mode 100644 official/release-3.4.2/json/guid.json create mode 100644 official/release-3.4.2/json/haptic.json create mode 100644 official/release-3.4.2/json/hints.json create mode 100644 official/release-3.4.2/json/init.json create mode 100644 official/release-3.4.2/json/iostream.json create mode 100644 official/release-3.4.2/json/joystick.json create mode 100644 official/release-3.4.2/json/keyboard.json create mode 100644 official/release-3.4.2/json/keycode.json create mode 100644 official/release-3.4.2/json/loadso.json create mode 100644 official/release-3.4.2/json/messagebox.json create mode 100644 official/release-3.4.2/json/misc.json create mode 100644 official/release-3.4.2/json/mouse.json create mode 100644 official/release-3.4.2/json/opengl.json create mode 100644 official/release-3.4.2/json/pen.json create mode 100644 official/release-3.4.2/json/pixels.json create mode 100644 official/release-3.4.2/json/power.json create mode 100644 official/release-3.4.2/json/process.json create mode 100644 official/release-3.4.2/json/properties.json create mode 100644 official/release-3.4.2/json/rect.json create mode 100644 official/release-3.4.2/json/render.json create mode 100644 official/release-3.4.2/json/scancode.json create mode 100644 official/release-3.4.2/json/sensor.json create mode 100644 official/release-3.4.2/json/storage.json create mode 100644 official/release-3.4.2/json/surface.json create mode 100644 official/release-3.4.2/json/system.json create mode 100644 official/release-3.4.2/json/time.json create mode 100644 official/release-3.4.2/json/timer.json create mode 100644 official/release-3.4.2/json/touch.json create mode 100644 official/release-3.4.2/json/tray.json create mode 100644 official/release-3.4.2/json/version.json create mode 100644 official/release-3.4.2/json/video.json create mode 100644 official/release-3.4.20/api/audio.zig create mode 100644 official/release-3.4.20/api/blendmode.zig create mode 100644 official/release-3.4.20/api/c.zig create mode 100644 official/release-3.4.20/api/camera.zig create mode 100644 official/release-3.4.20/api/clipboard.zig create mode 100644 official/release-3.4.20/api/dialog.zig create mode 100644 official/release-3.4.20/api/endian.zig create mode 100644 official/release-3.4.20/api/error.zig create mode 100644 official/release-3.4.20/api/events.zig create mode 100644 official/release-3.4.20/api/filesystem.zig create mode 100644 official/release-3.4.20/api/gamepad.zig create mode 100644 official/release-3.4.20/api/gpu.zig create mode 100644 official/release-3.4.20/api/guid.zig create mode 100644 official/release-3.4.20/api/haptic.zig create mode 100644 official/release-3.4.20/api/hints.zig create mode 100644 official/release-3.4.20/api/init.zig create mode 100644 official/release-3.4.20/api/iostream.zig create mode 100644 official/release-3.4.20/api/joystick.zig create mode 100644 official/release-3.4.20/api/keyboard.zig create mode 100644 official/release-3.4.20/api/keycode.zig create mode 100644 official/release-3.4.20/api/loadso.zig create mode 100644 official/release-3.4.20/api/messagebox.zig create mode 100644 official/release-3.4.20/api/misc.zig create mode 100644 official/release-3.4.20/api/mouse.zig create mode 100644 official/release-3.4.20/api/opengl.zig create mode 100644 official/release-3.4.20/api/pen.zig create mode 100644 official/release-3.4.20/api/pixels.zig create mode 100644 official/release-3.4.20/api/power.zig create mode 100644 official/release-3.4.20/api/process.zig create mode 100644 official/release-3.4.20/api/properties.zig create mode 100644 official/release-3.4.20/api/rect.zig create mode 100644 official/release-3.4.20/api/render.zig create mode 100644 official/release-3.4.20/api/scancode.zig create mode 100644 official/release-3.4.20/api/sensor.zig create mode 100644 official/release-3.4.20/api/stdinc.zig create mode 100644 official/release-3.4.20/api/storage.zig create mode 100644 official/release-3.4.20/api/surface.zig create mode 100644 official/release-3.4.20/api/system.zig create mode 100644 official/release-3.4.20/api/time.zig create mode 100644 official/release-3.4.20/api/timer.zig create mode 100644 official/release-3.4.20/api/touch.zig create mode 100644 official/release-3.4.20/api/tray.zig create mode 100644 official/release-3.4.20/api/version.zig create mode 100644 official/release-3.4.20/api/video.zig create mode 100644 official/release-3.4.20/json/audio.json create mode 100644 official/release-3.4.20/json/blendmode.json create mode 100644 official/release-3.4.20/json/camera.json create mode 100644 official/release-3.4.20/json/clipboard.json create mode 100644 official/release-3.4.20/json/dialog.json create mode 100644 official/release-3.4.20/json/endian.json create mode 100644 official/release-3.4.20/json/error.json create mode 100644 official/release-3.4.20/json/events.json create mode 100644 official/release-3.4.20/json/filesystem.json create mode 100644 official/release-3.4.20/json/gamepad.json create mode 100644 official/release-3.4.20/json/gpu.json create mode 100644 official/release-3.4.20/json/guid.json create mode 100644 official/release-3.4.20/json/haptic.json create mode 100644 official/release-3.4.20/json/hints.json create mode 100644 official/release-3.4.20/json/init.json create mode 100644 official/release-3.4.20/json/iostream.json create mode 100644 official/release-3.4.20/json/joystick.json create mode 100644 official/release-3.4.20/json/keyboard.json create mode 100644 official/release-3.4.20/json/keycode.json create mode 100644 official/release-3.4.20/json/loadso.json create mode 100644 official/release-3.4.20/json/messagebox.json create mode 100644 official/release-3.4.20/json/misc.json create mode 100644 official/release-3.4.20/json/mouse.json create mode 100644 official/release-3.4.20/json/opengl.json create mode 100644 official/release-3.4.20/json/pen.json create mode 100644 official/release-3.4.20/json/pixels.json create mode 100644 official/release-3.4.20/json/power.json create mode 100644 official/release-3.4.20/json/process.json create mode 100644 official/release-3.4.20/json/properties.json create mode 100644 official/release-3.4.20/json/rect.json create mode 100644 official/release-3.4.20/json/render.json create mode 100644 official/release-3.4.20/json/scancode.json create mode 100644 official/release-3.4.20/json/sensor.json create mode 100644 official/release-3.4.20/json/storage.json create mode 100644 official/release-3.4.20/json/surface.json create mode 100644 official/release-3.4.20/json/system.json create mode 100644 official/release-3.4.20/json/time.json create mode 100644 official/release-3.4.20/json/timer.json create mode 100644 official/release-3.4.20/json/touch.json create mode 100644 official/release-3.4.20/json/tray.json create mode 100644 official/release-3.4.20/json/version.json create mode 100644 official/release-3.4.20/json/video.json create mode 100644 official/release-3.4.4/api/audio.zig create mode 100644 official/release-3.4.4/api/blendmode.zig create mode 100644 official/release-3.4.4/api/c.zig create mode 100644 official/release-3.4.4/api/camera.zig create mode 100644 official/release-3.4.4/api/clipboard.zig create mode 100644 official/release-3.4.4/api/dialog.zig create mode 100644 official/release-3.4.4/api/endian.zig create mode 100644 official/release-3.4.4/api/error.zig create mode 100644 official/release-3.4.4/api/events.zig create mode 100644 official/release-3.4.4/api/filesystem.zig create mode 100644 official/release-3.4.4/api/gamepad.zig create mode 100644 official/release-3.4.4/api/gpu.zig create mode 100644 official/release-3.4.4/api/guid.zig create mode 100644 official/release-3.4.4/api/haptic.zig create mode 100644 official/release-3.4.4/api/hints.zig create mode 100644 official/release-3.4.4/api/init.zig create mode 100644 official/release-3.4.4/api/iostream.zig create mode 100644 official/release-3.4.4/api/joystick.zig create mode 100644 official/release-3.4.4/api/keyboard.zig create mode 100644 official/release-3.4.4/api/keycode.zig create mode 100644 official/release-3.4.4/api/loadso.zig create mode 100644 official/release-3.4.4/api/messagebox.zig create mode 100644 official/release-3.4.4/api/misc.zig create mode 100644 official/release-3.4.4/api/mouse.zig create mode 100644 official/release-3.4.4/api/opengl.zig create mode 100644 official/release-3.4.4/api/pen.zig create mode 100644 official/release-3.4.4/api/pixels.zig create mode 100644 official/release-3.4.4/api/power.zig create mode 100644 official/release-3.4.4/api/process.zig create mode 100644 official/release-3.4.4/api/properties.zig create mode 100644 official/release-3.4.4/api/rect.zig create mode 100644 official/release-3.4.4/api/render.zig create mode 100644 official/release-3.4.4/api/scancode.zig create mode 100644 official/release-3.4.4/api/sensor.zig create mode 100644 official/release-3.4.4/api/stdinc.zig create mode 100644 official/release-3.4.4/api/storage.zig create mode 100644 official/release-3.4.4/api/surface.zig create mode 100644 official/release-3.4.4/api/system.zig create mode 100644 official/release-3.4.4/api/time.zig create mode 100644 official/release-3.4.4/api/timer.zig create mode 100644 official/release-3.4.4/api/touch.zig create mode 100644 official/release-3.4.4/api/tray.zig create mode 100644 official/release-3.4.4/api/version.zig create mode 100644 official/release-3.4.4/api/video.zig create mode 100644 official/release-3.4.4/json/audio.json create mode 100644 official/release-3.4.4/json/blendmode.json create mode 100644 official/release-3.4.4/json/camera.json create mode 100644 official/release-3.4.4/json/clipboard.json create mode 100644 official/release-3.4.4/json/dialog.json create mode 100644 official/release-3.4.4/json/endian.json create mode 100644 official/release-3.4.4/json/error.json create mode 100644 official/release-3.4.4/json/events.json create mode 100644 official/release-3.4.4/json/filesystem.json create mode 100644 official/release-3.4.4/json/gamepad.json create mode 100644 official/release-3.4.4/json/gpu.json create mode 100644 official/release-3.4.4/json/guid.json create mode 100644 official/release-3.4.4/json/haptic.json create mode 100644 official/release-3.4.4/json/hints.json create mode 100644 official/release-3.4.4/json/init.json create mode 100644 official/release-3.4.4/json/iostream.json create mode 100644 official/release-3.4.4/json/joystick.json create mode 100644 official/release-3.4.4/json/keyboard.json create mode 100644 official/release-3.4.4/json/keycode.json create mode 100644 official/release-3.4.4/json/loadso.json create mode 100644 official/release-3.4.4/json/messagebox.json create mode 100644 official/release-3.4.4/json/misc.json create mode 100644 official/release-3.4.4/json/mouse.json create mode 100644 official/release-3.4.4/json/opengl.json create mode 100644 official/release-3.4.4/json/pen.json create mode 100644 official/release-3.4.4/json/pixels.json create mode 100644 official/release-3.4.4/json/power.json create mode 100644 official/release-3.4.4/json/process.json create mode 100644 official/release-3.4.4/json/properties.json create mode 100644 official/release-3.4.4/json/rect.json create mode 100644 official/release-3.4.4/json/render.json create mode 100644 official/release-3.4.4/json/scancode.json create mode 100644 official/release-3.4.4/json/sensor.json create mode 100644 official/release-3.4.4/json/storage.json create mode 100644 official/release-3.4.4/json/surface.json create mode 100644 official/release-3.4.4/json/system.json create mode 100644 official/release-3.4.4/json/time.json create mode 100644 official/release-3.4.4/json/timer.json create mode 100644 official/release-3.4.4/json/touch.json create mode 100644 official/release-3.4.4/json/tray.json create mode 100644 official/release-3.4.4/json/version.json create mode 100644 official/release-3.4.4/json/video.json create mode 100644 official/release-3.4.6/api/audio.zig create mode 100644 official/release-3.4.6/api/blendmode.zig create mode 100644 official/release-3.4.6/api/c.zig create mode 100644 official/release-3.4.6/api/camera.zig create mode 100644 official/release-3.4.6/api/clipboard.zig create mode 100644 official/release-3.4.6/api/dialog.zig create mode 100644 official/release-3.4.6/api/endian.zig create mode 100644 official/release-3.4.6/api/error.zig create mode 100644 official/release-3.4.6/api/events.zig create mode 100644 official/release-3.4.6/api/filesystem.zig create mode 100644 official/release-3.4.6/api/gamepad.zig create mode 100644 official/release-3.4.6/api/gpu.zig create mode 100644 official/release-3.4.6/api/guid.zig create mode 100644 official/release-3.4.6/api/haptic.zig create mode 100644 official/release-3.4.6/api/hints.zig create mode 100644 official/release-3.4.6/api/init.zig create mode 100644 official/release-3.4.6/api/iostream.zig create mode 100644 official/release-3.4.6/api/joystick.zig create mode 100644 official/release-3.4.6/api/keyboard.zig create mode 100644 official/release-3.4.6/api/keycode.zig create mode 100644 official/release-3.4.6/api/loadso.zig create mode 100644 official/release-3.4.6/api/messagebox.zig create mode 100644 official/release-3.4.6/api/misc.zig create mode 100644 official/release-3.4.6/api/mouse.zig create mode 100644 official/release-3.4.6/api/opengl.zig create mode 100644 official/release-3.4.6/api/pen.zig create mode 100644 official/release-3.4.6/api/pixels.zig create mode 100644 official/release-3.4.6/api/power.zig create mode 100644 official/release-3.4.6/api/process.zig create mode 100644 official/release-3.4.6/api/properties.zig create mode 100644 official/release-3.4.6/api/rect.zig create mode 100644 official/release-3.4.6/api/render.zig create mode 100644 official/release-3.4.6/api/scancode.zig create mode 100644 official/release-3.4.6/api/sensor.zig create mode 100644 official/release-3.4.6/api/stdinc.zig create mode 100644 official/release-3.4.6/api/storage.zig create mode 100644 official/release-3.4.6/api/surface.zig create mode 100644 official/release-3.4.6/api/system.zig create mode 100644 official/release-3.4.6/api/time.zig create mode 100644 official/release-3.4.6/api/timer.zig create mode 100644 official/release-3.4.6/api/touch.zig create mode 100644 official/release-3.4.6/api/tray.zig create mode 100644 official/release-3.4.6/api/version.zig create mode 100644 official/release-3.4.6/api/video.zig create mode 100644 official/release-3.4.6/json/audio.json create mode 100644 official/release-3.4.6/json/blendmode.json create mode 100644 official/release-3.4.6/json/camera.json create mode 100644 official/release-3.4.6/json/clipboard.json create mode 100644 official/release-3.4.6/json/dialog.json create mode 100644 official/release-3.4.6/json/endian.json create mode 100644 official/release-3.4.6/json/error.json create mode 100644 official/release-3.4.6/json/events.json create mode 100644 official/release-3.4.6/json/filesystem.json create mode 100644 official/release-3.4.6/json/gamepad.json create mode 100644 official/release-3.4.6/json/gpu.json create mode 100644 official/release-3.4.6/json/guid.json create mode 100644 official/release-3.4.6/json/haptic.json create mode 100644 official/release-3.4.6/json/hints.json create mode 100644 official/release-3.4.6/json/init.json create mode 100644 official/release-3.4.6/json/iostream.json create mode 100644 official/release-3.4.6/json/joystick.json create mode 100644 official/release-3.4.6/json/keyboard.json create mode 100644 official/release-3.4.6/json/keycode.json create mode 100644 official/release-3.4.6/json/loadso.json create mode 100644 official/release-3.4.6/json/messagebox.json create mode 100644 official/release-3.4.6/json/misc.json create mode 100644 official/release-3.4.6/json/mouse.json create mode 100644 official/release-3.4.6/json/opengl.json create mode 100644 official/release-3.4.6/json/pen.json create mode 100644 official/release-3.4.6/json/pixels.json create mode 100644 official/release-3.4.6/json/power.json create mode 100644 official/release-3.4.6/json/process.json create mode 100644 official/release-3.4.6/json/properties.json create mode 100644 official/release-3.4.6/json/rect.json create mode 100644 official/release-3.4.6/json/render.json create mode 100644 official/release-3.4.6/json/scancode.json create mode 100644 official/release-3.4.6/json/sensor.json create mode 100644 official/release-3.4.6/json/storage.json create mode 100644 official/release-3.4.6/json/surface.json create mode 100644 official/release-3.4.6/json/system.json create mode 100644 official/release-3.4.6/json/time.json create mode 100644 official/release-3.4.6/json/timer.json create mode 100644 official/release-3.4.6/json/touch.json create mode 100644 official/release-3.4.6/json/tray.json create mode 100644 official/release-3.4.6/json/version.json create mode 100644 official/release-3.4.6/json/video.json create mode 100644 official/release-3.4.8/api/audio.zig create mode 100644 official/release-3.4.8/api/blendmode.zig create mode 100644 official/release-3.4.8/api/c.zig create mode 100644 official/release-3.4.8/api/camera.zig create mode 100644 official/release-3.4.8/api/clipboard.zig create mode 100644 official/release-3.4.8/api/dialog.zig create mode 100644 official/release-3.4.8/api/endian.zig create mode 100644 official/release-3.4.8/api/error.zig create mode 100644 official/release-3.4.8/api/events.zig create mode 100644 official/release-3.4.8/api/filesystem.zig create mode 100644 official/release-3.4.8/api/gamepad.zig create mode 100644 official/release-3.4.8/api/gpu.zig create mode 100644 official/release-3.4.8/api/guid.zig create mode 100644 official/release-3.4.8/api/haptic.zig create mode 100644 official/release-3.4.8/api/hints.zig create mode 100644 official/release-3.4.8/api/init.zig create mode 100644 official/release-3.4.8/api/iostream.zig create mode 100644 official/release-3.4.8/api/joystick.zig create mode 100644 official/release-3.4.8/api/keyboard.zig create mode 100644 official/release-3.4.8/api/keycode.zig create mode 100644 official/release-3.4.8/api/loadso.zig create mode 100644 official/release-3.4.8/api/messagebox.zig create mode 100644 official/release-3.4.8/api/misc.zig create mode 100644 official/release-3.4.8/api/mouse.zig create mode 100644 official/release-3.4.8/api/opengl.zig create mode 100644 official/release-3.4.8/api/pen.zig create mode 100644 official/release-3.4.8/api/pixels.zig create mode 100644 official/release-3.4.8/api/power.zig create mode 100644 official/release-3.4.8/api/process.zig create mode 100644 official/release-3.4.8/api/properties.zig create mode 100644 official/release-3.4.8/api/rect.zig create mode 100644 official/release-3.4.8/api/render.zig create mode 100644 official/release-3.4.8/api/scancode.zig create mode 100644 official/release-3.4.8/api/sensor.zig create mode 100644 official/release-3.4.8/api/stdinc.zig create mode 100644 official/release-3.4.8/api/storage.zig create mode 100644 official/release-3.4.8/api/surface.zig create mode 100644 official/release-3.4.8/api/system.zig create mode 100644 official/release-3.4.8/api/time.zig create mode 100644 official/release-3.4.8/api/timer.zig create mode 100644 official/release-3.4.8/api/touch.zig create mode 100644 official/release-3.4.8/api/tray.zig create mode 100644 official/release-3.4.8/api/version.zig create mode 100644 official/release-3.4.8/api/video.zig create mode 100644 official/release-3.4.8/json/audio.json create mode 100644 official/release-3.4.8/json/blendmode.json create mode 100644 official/release-3.4.8/json/camera.json create mode 100644 official/release-3.4.8/json/clipboard.json create mode 100644 official/release-3.4.8/json/dialog.json create mode 100644 official/release-3.4.8/json/endian.json create mode 100644 official/release-3.4.8/json/error.json create mode 100644 official/release-3.4.8/json/events.json create mode 100644 official/release-3.4.8/json/filesystem.json create mode 100644 official/release-3.4.8/json/gamepad.json create mode 100644 official/release-3.4.8/json/gpu.json create mode 100644 official/release-3.4.8/json/guid.json create mode 100644 official/release-3.4.8/json/haptic.json create mode 100644 official/release-3.4.8/json/hints.json create mode 100644 official/release-3.4.8/json/init.json create mode 100644 official/release-3.4.8/json/iostream.json create mode 100644 official/release-3.4.8/json/joystick.json create mode 100644 official/release-3.4.8/json/keyboard.json create mode 100644 official/release-3.4.8/json/keycode.json create mode 100644 official/release-3.4.8/json/loadso.json create mode 100644 official/release-3.4.8/json/messagebox.json create mode 100644 official/release-3.4.8/json/misc.json create mode 100644 official/release-3.4.8/json/mouse.json create mode 100644 official/release-3.4.8/json/opengl.json create mode 100644 official/release-3.4.8/json/pen.json create mode 100644 official/release-3.4.8/json/pixels.json create mode 100644 official/release-3.4.8/json/power.json create mode 100644 official/release-3.4.8/json/process.json create mode 100644 official/release-3.4.8/json/properties.json create mode 100644 official/release-3.4.8/json/rect.json create mode 100644 official/release-3.4.8/json/render.json create mode 100644 official/release-3.4.8/json/scancode.json create mode 100644 official/release-3.4.8/json/sensor.json create mode 100644 official/release-3.4.8/json/storage.json create mode 100644 official/release-3.4.8/json/surface.json create mode 100644 official/release-3.4.8/json/system.json create mode 100644 official/release-3.4.8/json/time.json create mode 100644 official/release-3.4.8/json/timer.json create mode 100644 official/release-3.4.8/json/touch.json create mode 100644 official/release-3.4.8/json/tray.json create mode 100644 official/release-3.4.8/json/version.json create mode 100644 official/release-3.4.8/json/video.json diff --git a/castholm/v0.4.1-3.4.2/api/audio.zig b/castholm/v0.4.1-3.4.2/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.4.1-3.4.2/api/blendmode.zig b/castholm/v0.4.1-3.4.2/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.4.1-3.4.2/api/c.zig b/castholm/v0.4.1-3.4.2/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.4.1-3.4.2/api/camera.zig b/castholm/v0.4.1-3.4.2/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.4.1-3.4.2/api/clipboard.zig b/castholm/v0.4.1-3.4.2/api/clipboard.zig new file mode 100644 index 0000000..6fe8270 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.4.1-3.4.2/api/dialog.zig b/castholm/v0.4.1-3.4.2/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.4.1-3.4.2/api/endian.zig b/castholm/v0.4.1-3.4.2/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.4.1-3.4.2/api/error.zig b/castholm/v0.4.1-3.4.2/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.4.1-3.4.2/api/events.zig b/castholm/v0.4.1-3.4.2/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.4.1-3.4.2/api/filesystem.zig b/castholm/v0.4.1-3.4.2/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.4.1-3.4.2/api/gamepad.zig b/castholm/v0.4.1-3.4.2/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.4.1-3.4.2/api/gpu.zig b/castholm/v0.4.1-3.4.2/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.4.1-3.4.2/api/guid.zig b/castholm/v0.4.1-3.4.2/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.4.1-3.4.2/api/haptic.zig b/castholm/v0.4.1-3.4.2/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.4.1-3.4.2/api/hints.zig b/castholm/v0.4.1-3.4.2/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.4.1-3.4.2/api/init.zig b/castholm/v0.4.1-3.4.2/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.4.1-3.4.2/api/iostream.zig b/castholm/v0.4.1-3.4.2/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.4.1-3.4.2/api/joystick.zig b/castholm/v0.4.1-3.4.2/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.4.1-3.4.2/api/keyboard.zig b/castholm/v0.4.1-3.4.2/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.4.1-3.4.2/api/keycode.zig b/castholm/v0.4.1-3.4.2/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.4.1-3.4.2/api/loadso.zig b/castholm/v0.4.1-3.4.2/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.4.1-3.4.2/api/messagebox.zig b/castholm/v0.4.1-3.4.2/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.4.1-3.4.2/api/misc.zig b/castholm/v0.4.1-3.4.2/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.4.1-3.4.2/api/mouse.zig b/castholm/v0.4.1-3.4.2/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.4.1-3.4.2/api/opengl.zig b/castholm/v0.4.1-3.4.2/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.4.1-3.4.2/api/pen.zig b/castholm/v0.4.1-3.4.2/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.4.1-3.4.2/api/pixels.zig b/castholm/v0.4.1-3.4.2/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.4.1-3.4.2/api/power.zig b/castholm/v0.4.1-3.4.2/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.4.1-3.4.2/api/process.zig b/castholm/v0.4.1-3.4.2/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.4.1-3.4.2/api/properties.zig b/castholm/v0.4.1-3.4.2/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.4.1-3.4.2/api/rect.zig b/castholm/v0.4.1-3.4.2/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.4.1-3.4.2/api/render.zig b/castholm/v0.4.1-3.4.2/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.4.1-3.4.2/api/scancode.zig b/castholm/v0.4.1-3.4.2/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.4.1-3.4.2/api/sensor.zig b/castholm/v0.4.1-3.4.2/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.4.1-3.4.2/api/stdinc.zig b/castholm/v0.4.1-3.4.2/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.4.1-3.4.2/api/storage.zig b/castholm/v0.4.1-3.4.2/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.4.1-3.4.2/api/surface.zig b/castholm/v0.4.1-3.4.2/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.4.1-3.4.2/api/system.zig b/castholm/v0.4.1-3.4.2/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.4.1-3.4.2/api/time.zig b/castholm/v0.4.1-3.4.2/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.4.1-3.4.2/api/timer.zig b/castholm/v0.4.1-3.4.2/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.4.1-3.4.2/api/touch.zig b/castholm/v0.4.1-3.4.2/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.4.1-3.4.2/api/tray.zig b/castholm/v0.4.1-3.4.2/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.4.1-3.4.2/api/version.zig b/castholm/v0.4.1-3.4.2/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.4.1-3.4.2/api/video.zig b/castholm/v0.4.1-3.4.2/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.4.1-3.4.2/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.4.1-3.4.2/json/audio.json b/castholm/v0.4.1-3.4.2/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/blendmode.json b/castholm/v0.4.1-3.4.2/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/camera.json b/castholm/v0.4.1-3.4.2/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/clipboard.json b/castholm/v0.4.1-3.4.2/json/clipboard.json new file mode 100644 index 0000000..53889c5 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char **" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/dialog.json b/castholm/v0.4.1-3.4.2/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/endian.json b/castholm/v0.4.1-3.4.2/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/error.json b/castholm/v0.4.1-3.4.2/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/events.json b/castholm/v0.4.1-3.4.2/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/filesystem.json b/castholm/v0.4.1-3.4.2/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/gamepad.json b/castholm/v0.4.1-3.4.2/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/gpu.json b/castholm/v0.4.1-3.4.2/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/guid.json b/castholm/v0.4.1-3.4.2/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/haptic.json b/castholm/v0.4.1-3.4.2/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/hints.json b/castholm/v0.4.1-3.4.2/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/init.json b/castholm/v0.4.1-3.4.2/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/iostream.json b/castholm/v0.4.1-3.4.2/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/joystick.json b/castholm/v0.4.1-3.4.2/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/keyboard.json b/castholm/v0.4.1-3.4.2/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/keycode.json b/castholm/v0.4.1-3.4.2/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/loadso.json b/castholm/v0.4.1-3.4.2/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/messagebox.json b/castholm/v0.4.1-3.4.2/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/misc.json b/castholm/v0.4.1-3.4.2/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/mouse.json b/castholm/v0.4.1-3.4.2/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/opengl.json b/castholm/v0.4.1-3.4.2/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/pen.json b/castholm/v0.4.1-3.4.2/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/pixels.json b/castholm/v0.4.1-3.4.2/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/power.json b/castholm/v0.4.1-3.4.2/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/process.json b/castholm/v0.4.1-3.4.2/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/properties.json b/castholm/v0.4.1-3.4.2/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/rect.json b/castholm/v0.4.1-3.4.2/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/render.json b/castholm/v0.4.1-3.4.2/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/scancode.json b/castholm/v0.4.1-3.4.2/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/sensor.json b/castholm/v0.4.1-3.4.2/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/storage.json b/castholm/v0.4.1-3.4.2/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/surface.json b/castholm/v0.4.1-3.4.2/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/system.json b/castholm/v0.4.1-3.4.2/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/time.json b/castholm/v0.4.1-3.4.2/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/timer.json b/castholm/v0.4.1-3.4.2/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/touch.json b/castholm/v0.4.1-3.4.2/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/tray.json b/castholm/v0.4.1-3.4.2/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/version.json b/castholm/v0.4.1-3.4.2/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.1-3.4.2/json/video.json b/castholm/v0.4.1-3.4.2/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.4.1-3.4.2/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/api/audio.zig b/castholm/v0.4.2-3.4.4/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.4.2-3.4.4/api/blendmode.zig b/castholm/v0.4.2-3.4.4/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.4.2-3.4.4/api/c.zig b/castholm/v0.4.2-3.4.4/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.4.2-3.4.4/api/camera.zig b/castholm/v0.4.2-3.4.4/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.4.2-3.4.4/api/clipboard.zig b/castholm/v0.4.2-3.4.4/api/clipboard.zig new file mode 100644 index 0000000..6fe8270 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.4.2-3.4.4/api/dialog.zig b/castholm/v0.4.2-3.4.4/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.4.2-3.4.4/api/endian.zig b/castholm/v0.4.2-3.4.4/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.4.2-3.4.4/api/error.zig b/castholm/v0.4.2-3.4.4/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.4.2-3.4.4/api/events.zig b/castholm/v0.4.2-3.4.4/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.4.2-3.4.4/api/filesystem.zig b/castholm/v0.4.2-3.4.4/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.4.2-3.4.4/api/gamepad.zig b/castholm/v0.4.2-3.4.4/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.4.2-3.4.4/api/gpu.zig b/castholm/v0.4.2-3.4.4/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.4.2-3.4.4/api/guid.zig b/castholm/v0.4.2-3.4.4/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.4.2-3.4.4/api/haptic.zig b/castholm/v0.4.2-3.4.4/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.4.2-3.4.4/api/hints.zig b/castholm/v0.4.2-3.4.4/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.4.2-3.4.4/api/init.zig b/castholm/v0.4.2-3.4.4/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.4.2-3.4.4/api/iostream.zig b/castholm/v0.4.2-3.4.4/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.4.2-3.4.4/api/joystick.zig b/castholm/v0.4.2-3.4.4/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.4.2-3.4.4/api/keyboard.zig b/castholm/v0.4.2-3.4.4/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.4.2-3.4.4/api/keycode.zig b/castholm/v0.4.2-3.4.4/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.4.2-3.4.4/api/loadso.zig b/castholm/v0.4.2-3.4.4/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.4.2-3.4.4/api/messagebox.zig b/castholm/v0.4.2-3.4.4/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.4.2-3.4.4/api/misc.zig b/castholm/v0.4.2-3.4.4/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.4.2-3.4.4/api/mouse.zig b/castholm/v0.4.2-3.4.4/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.4.2-3.4.4/api/opengl.zig b/castholm/v0.4.2-3.4.4/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.4.2-3.4.4/api/pen.zig b/castholm/v0.4.2-3.4.4/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.4.2-3.4.4/api/pixels.zig b/castholm/v0.4.2-3.4.4/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.4.2-3.4.4/api/power.zig b/castholm/v0.4.2-3.4.4/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.4.2-3.4.4/api/process.zig b/castholm/v0.4.2-3.4.4/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.4.2-3.4.4/api/properties.zig b/castholm/v0.4.2-3.4.4/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.4.2-3.4.4/api/rect.zig b/castholm/v0.4.2-3.4.4/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.4.2-3.4.4/api/render.zig b/castholm/v0.4.2-3.4.4/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.4.2-3.4.4/api/scancode.zig b/castholm/v0.4.2-3.4.4/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.4.2-3.4.4/api/sensor.zig b/castholm/v0.4.2-3.4.4/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.4.2-3.4.4/api/stdinc.zig b/castholm/v0.4.2-3.4.4/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.4.2-3.4.4/api/storage.zig b/castholm/v0.4.2-3.4.4/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.4.2-3.4.4/api/surface.zig b/castholm/v0.4.2-3.4.4/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.4.2-3.4.4/api/system.zig b/castholm/v0.4.2-3.4.4/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.4.2-3.4.4/api/time.zig b/castholm/v0.4.2-3.4.4/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.4.2-3.4.4/api/timer.zig b/castholm/v0.4.2-3.4.4/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.4.2-3.4.4/api/touch.zig b/castholm/v0.4.2-3.4.4/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.4.2-3.4.4/api/tray.zig b/castholm/v0.4.2-3.4.4/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.4.2-3.4.4/api/version.zig b/castholm/v0.4.2-3.4.4/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.4.2-3.4.4/api/video.zig b/castholm/v0.4.2-3.4.4/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.4.2-3.4.4/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.4.2-3.4.4/json/audio.json b/castholm/v0.4.2-3.4.4/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/blendmode.json b/castholm/v0.4.2-3.4.4/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/camera.json b/castholm/v0.4.2-3.4.4/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/clipboard.json b/castholm/v0.4.2-3.4.4/json/clipboard.json new file mode 100644 index 0000000..53889c5 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char **" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/dialog.json b/castholm/v0.4.2-3.4.4/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/endian.json b/castholm/v0.4.2-3.4.4/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/error.json b/castholm/v0.4.2-3.4.4/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/events.json b/castholm/v0.4.2-3.4.4/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/filesystem.json b/castholm/v0.4.2-3.4.4/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/gamepad.json b/castholm/v0.4.2-3.4.4/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/gpu.json b/castholm/v0.4.2-3.4.4/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/guid.json b/castholm/v0.4.2-3.4.4/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/haptic.json b/castholm/v0.4.2-3.4.4/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/hints.json b/castholm/v0.4.2-3.4.4/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/init.json b/castholm/v0.4.2-3.4.4/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/iostream.json b/castholm/v0.4.2-3.4.4/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/joystick.json b/castholm/v0.4.2-3.4.4/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/keyboard.json b/castholm/v0.4.2-3.4.4/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/keycode.json b/castholm/v0.4.2-3.4.4/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/loadso.json b/castholm/v0.4.2-3.4.4/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/messagebox.json b/castholm/v0.4.2-3.4.4/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/misc.json b/castholm/v0.4.2-3.4.4/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/mouse.json b/castholm/v0.4.2-3.4.4/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/opengl.json b/castholm/v0.4.2-3.4.4/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/pen.json b/castholm/v0.4.2-3.4.4/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/pixels.json b/castholm/v0.4.2-3.4.4/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/power.json b/castholm/v0.4.2-3.4.4/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/process.json b/castholm/v0.4.2-3.4.4/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/properties.json b/castholm/v0.4.2-3.4.4/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/rect.json b/castholm/v0.4.2-3.4.4/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/render.json b/castholm/v0.4.2-3.4.4/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/scancode.json b/castholm/v0.4.2-3.4.4/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/sensor.json b/castholm/v0.4.2-3.4.4/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/storage.json b/castholm/v0.4.2-3.4.4/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/surface.json b/castholm/v0.4.2-3.4.4/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/system.json b/castholm/v0.4.2-3.4.4/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/time.json b/castholm/v0.4.2-3.4.4/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/timer.json b/castholm/v0.4.2-3.4.4/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/touch.json b/castholm/v0.4.2-3.4.4/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/tray.json b/castholm/v0.4.2-3.4.4/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/version.json b/castholm/v0.4.2-3.4.4/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.4.2-3.4.4/json/video.json b/castholm/v0.4.2-3.4.4/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.4.2-3.4.4/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/api/audio.zig b/castholm/v0.5.0-3.4.8/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.5.0-3.4.8/api/blendmode.zig b/castholm/v0.5.0-3.4.8/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.5.0-3.4.8/api/c.zig b/castholm/v0.5.0-3.4.8/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.5.0-3.4.8/api/camera.zig b/castholm/v0.5.0-3.4.8/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.5.0-3.4.8/api/clipboard.zig b/castholm/v0.5.0-3.4.8/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.5.0-3.4.8/api/dialog.zig b/castholm/v0.5.0-3.4.8/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.5.0-3.4.8/api/endian.zig b/castholm/v0.5.0-3.4.8/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.0-3.4.8/api/error.zig b/castholm/v0.5.0-3.4.8/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.5.0-3.4.8/api/events.zig b/castholm/v0.5.0-3.4.8/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.5.0-3.4.8/api/filesystem.zig b/castholm/v0.5.0-3.4.8/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.5.0-3.4.8/api/gamepad.zig b/castholm/v0.5.0-3.4.8/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.5.0-3.4.8/api/gpu.zig b/castholm/v0.5.0-3.4.8/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.5.0-3.4.8/api/guid.zig b/castholm/v0.5.0-3.4.8/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.5.0-3.4.8/api/haptic.zig b/castholm/v0.5.0-3.4.8/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.5.0-3.4.8/api/hints.zig b/castholm/v0.5.0-3.4.8/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.5.0-3.4.8/api/init.zig b/castholm/v0.5.0-3.4.8/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.5.0-3.4.8/api/iostream.zig b/castholm/v0.5.0-3.4.8/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.5.0-3.4.8/api/joystick.zig b/castholm/v0.5.0-3.4.8/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.5.0-3.4.8/api/keyboard.zig b/castholm/v0.5.0-3.4.8/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.0-3.4.8/api/keycode.zig b/castholm/v0.5.0-3.4.8/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.5.0-3.4.8/api/loadso.zig b/castholm/v0.5.0-3.4.8/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.5.0-3.4.8/api/messagebox.zig b/castholm/v0.5.0-3.4.8/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.0-3.4.8/api/misc.zig b/castholm/v0.5.0-3.4.8/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.5.0-3.4.8/api/mouse.zig b/castholm/v0.5.0-3.4.8/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.5.0-3.4.8/api/opengl.zig b/castholm/v0.5.0-3.4.8/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.0-3.4.8/api/pen.zig b/castholm/v0.5.0-3.4.8/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.5.0-3.4.8/api/pixels.zig b/castholm/v0.5.0-3.4.8/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.5.0-3.4.8/api/power.zig b/castholm/v0.5.0-3.4.8/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.5.0-3.4.8/api/process.zig b/castholm/v0.5.0-3.4.8/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.5.0-3.4.8/api/properties.zig b/castholm/v0.5.0-3.4.8/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.5.0-3.4.8/api/rect.zig b/castholm/v0.5.0-3.4.8/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.5.0-3.4.8/api/render.zig b/castholm/v0.5.0-3.4.8/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.5.0-3.4.8/api/scancode.zig b/castholm/v0.5.0-3.4.8/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.5.0-3.4.8/api/sensor.zig b/castholm/v0.5.0-3.4.8/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.5.0-3.4.8/api/stdinc.zig b/castholm/v0.5.0-3.4.8/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.5.0-3.4.8/api/storage.zig b/castholm/v0.5.0-3.4.8/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.5.0-3.4.8/api/surface.zig b/castholm/v0.5.0-3.4.8/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.5.0-3.4.8/api/system.zig b/castholm/v0.5.0-3.4.8/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.5.0-3.4.8/api/time.zig b/castholm/v0.5.0-3.4.8/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.5.0-3.4.8/api/timer.zig b/castholm/v0.5.0-3.4.8/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.5.0-3.4.8/api/touch.zig b/castholm/v0.5.0-3.4.8/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.5.0-3.4.8/api/tray.zig b/castholm/v0.5.0-3.4.8/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.5.0-3.4.8/api/version.zig b/castholm/v0.5.0-3.4.8/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.5.0-3.4.8/api/video.zig b/castholm/v0.5.0-3.4.8/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.5.0-3.4.8/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.5.0-3.4.8/json/audio.json b/castholm/v0.5.0-3.4.8/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/blendmode.json b/castholm/v0.5.0-3.4.8/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/camera.json b/castholm/v0.5.0-3.4.8/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/clipboard.json b/castholm/v0.5.0-3.4.8/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/dialog.json b/castholm/v0.5.0-3.4.8/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/endian.json b/castholm/v0.5.0-3.4.8/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/error.json b/castholm/v0.5.0-3.4.8/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/events.json b/castholm/v0.5.0-3.4.8/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/filesystem.json b/castholm/v0.5.0-3.4.8/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/gamepad.json b/castholm/v0.5.0-3.4.8/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/gpu.json b/castholm/v0.5.0-3.4.8/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/guid.json b/castholm/v0.5.0-3.4.8/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/haptic.json b/castholm/v0.5.0-3.4.8/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/hints.json b/castholm/v0.5.0-3.4.8/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/init.json b/castholm/v0.5.0-3.4.8/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/iostream.json b/castholm/v0.5.0-3.4.8/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/joystick.json b/castholm/v0.5.0-3.4.8/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/keyboard.json b/castholm/v0.5.0-3.4.8/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/keycode.json b/castholm/v0.5.0-3.4.8/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/loadso.json b/castholm/v0.5.0-3.4.8/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/messagebox.json b/castholm/v0.5.0-3.4.8/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/misc.json b/castholm/v0.5.0-3.4.8/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/mouse.json b/castholm/v0.5.0-3.4.8/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/opengl.json b/castholm/v0.5.0-3.4.8/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/pen.json b/castholm/v0.5.0-3.4.8/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/pixels.json b/castholm/v0.5.0-3.4.8/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/power.json b/castholm/v0.5.0-3.4.8/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/process.json b/castholm/v0.5.0-3.4.8/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/properties.json b/castholm/v0.5.0-3.4.8/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/rect.json b/castholm/v0.5.0-3.4.8/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/render.json b/castholm/v0.5.0-3.4.8/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/scancode.json b/castholm/v0.5.0-3.4.8/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/sensor.json b/castholm/v0.5.0-3.4.8/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/storage.json b/castholm/v0.5.0-3.4.8/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/surface.json b/castholm/v0.5.0-3.4.8/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/system.json b/castholm/v0.5.0-3.4.8/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/time.json b/castholm/v0.5.0-3.4.8/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/timer.json b/castholm/v0.5.0-3.4.8/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/touch.json b/castholm/v0.5.0-3.4.8/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/tray.json b/castholm/v0.5.0-3.4.8/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/version.json b/castholm/v0.5.0-3.4.8/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.0-3.4.8/json/video.json b/castholm/v0.5.0-3.4.8/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.5.0-3.4.8/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/api/audio.zig b/castholm/v0.5.1-3.4.10/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.5.1-3.4.10/api/blendmode.zig b/castholm/v0.5.1-3.4.10/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.5.1-3.4.10/api/c.zig b/castholm/v0.5.1-3.4.10/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.5.1-3.4.10/api/camera.zig b/castholm/v0.5.1-3.4.10/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.5.1-3.4.10/api/clipboard.zig b/castholm/v0.5.1-3.4.10/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.5.1-3.4.10/api/dialog.zig b/castholm/v0.5.1-3.4.10/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.5.1-3.4.10/api/endian.zig b/castholm/v0.5.1-3.4.10/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.1-3.4.10/api/error.zig b/castholm/v0.5.1-3.4.10/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.5.1-3.4.10/api/events.zig b/castholm/v0.5.1-3.4.10/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.5.1-3.4.10/api/filesystem.zig b/castholm/v0.5.1-3.4.10/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.5.1-3.4.10/api/gamepad.zig b/castholm/v0.5.1-3.4.10/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.5.1-3.4.10/api/gpu.zig b/castholm/v0.5.1-3.4.10/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.5.1-3.4.10/api/guid.zig b/castholm/v0.5.1-3.4.10/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.5.1-3.4.10/api/haptic.zig b/castholm/v0.5.1-3.4.10/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.5.1-3.4.10/api/hints.zig b/castholm/v0.5.1-3.4.10/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.5.1-3.4.10/api/init.zig b/castholm/v0.5.1-3.4.10/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.5.1-3.4.10/api/iostream.zig b/castholm/v0.5.1-3.4.10/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.5.1-3.4.10/api/joystick.zig b/castholm/v0.5.1-3.4.10/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.5.1-3.4.10/api/keyboard.zig b/castholm/v0.5.1-3.4.10/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.1-3.4.10/api/keycode.zig b/castholm/v0.5.1-3.4.10/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.5.1-3.4.10/api/loadso.zig b/castholm/v0.5.1-3.4.10/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.5.1-3.4.10/api/messagebox.zig b/castholm/v0.5.1-3.4.10/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.1-3.4.10/api/misc.zig b/castholm/v0.5.1-3.4.10/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.5.1-3.4.10/api/mouse.zig b/castholm/v0.5.1-3.4.10/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.5.1-3.4.10/api/opengl.zig b/castholm/v0.5.1-3.4.10/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.1-3.4.10/api/pen.zig b/castholm/v0.5.1-3.4.10/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.5.1-3.4.10/api/pixels.zig b/castholm/v0.5.1-3.4.10/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.5.1-3.4.10/api/power.zig b/castholm/v0.5.1-3.4.10/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.5.1-3.4.10/api/process.zig b/castholm/v0.5.1-3.4.10/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.5.1-3.4.10/api/properties.zig b/castholm/v0.5.1-3.4.10/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.5.1-3.4.10/api/rect.zig b/castholm/v0.5.1-3.4.10/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.5.1-3.4.10/api/render.zig b/castholm/v0.5.1-3.4.10/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.5.1-3.4.10/api/scancode.zig b/castholm/v0.5.1-3.4.10/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.5.1-3.4.10/api/sensor.zig b/castholm/v0.5.1-3.4.10/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.5.1-3.4.10/api/stdinc.zig b/castholm/v0.5.1-3.4.10/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.5.1-3.4.10/api/storage.zig b/castholm/v0.5.1-3.4.10/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.5.1-3.4.10/api/surface.zig b/castholm/v0.5.1-3.4.10/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.5.1-3.4.10/api/system.zig b/castholm/v0.5.1-3.4.10/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.5.1-3.4.10/api/time.zig b/castholm/v0.5.1-3.4.10/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.5.1-3.4.10/api/timer.zig b/castholm/v0.5.1-3.4.10/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.5.1-3.4.10/api/touch.zig b/castholm/v0.5.1-3.4.10/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.5.1-3.4.10/api/tray.zig b/castholm/v0.5.1-3.4.10/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.5.1-3.4.10/api/version.zig b/castholm/v0.5.1-3.4.10/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.5.1-3.4.10/api/video.zig b/castholm/v0.5.1-3.4.10/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.5.1-3.4.10/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.5.1-3.4.10/json/audio.json b/castholm/v0.5.1-3.4.10/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/blendmode.json b/castholm/v0.5.1-3.4.10/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/camera.json b/castholm/v0.5.1-3.4.10/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/clipboard.json b/castholm/v0.5.1-3.4.10/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/dialog.json b/castholm/v0.5.1-3.4.10/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/endian.json b/castholm/v0.5.1-3.4.10/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/error.json b/castholm/v0.5.1-3.4.10/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/events.json b/castholm/v0.5.1-3.4.10/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/filesystem.json b/castholm/v0.5.1-3.4.10/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/gamepad.json b/castholm/v0.5.1-3.4.10/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/gpu.json b/castholm/v0.5.1-3.4.10/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/guid.json b/castholm/v0.5.1-3.4.10/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/haptic.json b/castholm/v0.5.1-3.4.10/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/hints.json b/castholm/v0.5.1-3.4.10/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/init.json b/castholm/v0.5.1-3.4.10/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/iostream.json b/castholm/v0.5.1-3.4.10/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/joystick.json b/castholm/v0.5.1-3.4.10/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/keyboard.json b/castholm/v0.5.1-3.4.10/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/keycode.json b/castholm/v0.5.1-3.4.10/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/loadso.json b/castholm/v0.5.1-3.4.10/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/messagebox.json b/castholm/v0.5.1-3.4.10/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/misc.json b/castholm/v0.5.1-3.4.10/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/mouse.json b/castholm/v0.5.1-3.4.10/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/opengl.json b/castholm/v0.5.1-3.4.10/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/pen.json b/castholm/v0.5.1-3.4.10/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/pixels.json b/castholm/v0.5.1-3.4.10/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/power.json b/castholm/v0.5.1-3.4.10/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/process.json b/castholm/v0.5.1-3.4.10/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/properties.json b/castholm/v0.5.1-3.4.10/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/rect.json b/castholm/v0.5.1-3.4.10/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/render.json b/castholm/v0.5.1-3.4.10/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/scancode.json b/castholm/v0.5.1-3.4.10/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/sensor.json b/castholm/v0.5.1-3.4.10/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/storage.json b/castholm/v0.5.1-3.4.10/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/surface.json b/castholm/v0.5.1-3.4.10/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/system.json b/castholm/v0.5.1-3.4.10/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/time.json b/castholm/v0.5.1-3.4.10/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/timer.json b/castholm/v0.5.1-3.4.10/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/touch.json b/castholm/v0.5.1-3.4.10/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/tray.json b/castholm/v0.5.1-3.4.10/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/version.json b/castholm/v0.5.1-3.4.10/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.1-3.4.10/json/video.json b/castholm/v0.5.1-3.4.10/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.5.1-3.4.10/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/api/audio.zig b/castholm/v0.5.2-3.4.12/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.5.2-3.4.12/api/blendmode.zig b/castholm/v0.5.2-3.4.12/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.5.2-3.4.12/api/c.zig b/castholm/v0.5.2-3.4.12/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.5.2-3.4.12/api/camera.zig b/castholm/v0.5.2-3.4.12/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.5.2-3.4.12/api/clipboard.zig b/castholm/v0.5.2-3.4.12/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.5.2-3.4.12/api/dialog.zig b/castholm/v0.5.2-3.4.12/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.5.2-3.4.12/api/endian.zig b/castholm/v0.5.2-3.4.12/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.2-3.4.12/api/error.zig b/castholm/v0.5.2-3.4.12/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.5.2-3.4.12/api/events.zig b/castholm/v0.5.2-3.4.12/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.5.2-3.4.12/api/filesystem.zig b/castholm/v0.5.2-3.4.12/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.5.2-3.4.12/api/gamepad.zig b/castholm/v0.5.2-3.4.12/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.5.2-3.4.12/api/gpu.zig b/castholm/v0.5.2-3.4.12/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.5.2-3.4.12/api/guid.zig b/castholm/v0.5.2-3.4.12/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.5.2-3.4.12/api/haptic.zig b/castholm/v0.5.2-3.4.12/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.5.2-3.4.12/api/hints.zig b/castholm/v0.5.2-3.4.12/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.5.2-3.4.12/api/init.zig b/castholm/v0.5.2-3.4.12/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.5.2-3.4.12/api/iostream.zig b/castholm/v0.5.2-3.4.12/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.5.2-3.4.12/api/joystick.zig b/castholm/v0.5.2-3.4.12/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.5.2-3.4.12/api/keyboard.zig b/castholm/v0.5.2-3.4.12/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.2-3.4.12/api/keycode.zig b/castholm/v0.5.2-3.4.12/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.5.2-3.4.12/api/loadso.zig b/castholm/v0.5.2-3.4.12/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.5.2-3.4.12/api/messagebox.zig b/castholm/v0.5.2-3.4.12/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.2-3.4.12/api/misc.zig b/castholm/v0.5.2-3.4.12/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.5.2-3.4.12/api/mouse.zig b/castholm/v0.5.2-3.4.12/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.5.2-3.4.12/api/opengl.zig b/castholm/v0.5.2-3.4.12/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.2-3.4.12/api/pen.zig b/castholm/v0.5.2-3.4.12/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.5.2-3.4.12/api/pixels.zig b/castholm/v0.5.2-3.4.12/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.5.2-3.4.12/api/power.zig b/castholm/v0.5.2-3.4.12/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.5.2-3.4.12/api/process.zig b/castholm/v0.5.2-3.4.12/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.5.2-3.4.12/api/properties.zig b/castholm/v0.5.2-3.4.12/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.5.2-3.4.12/api/rect.zig b/castholm/v0.5.2-3.4.12/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.5.2-3.4.12/api/render.zig b/castholm/v0.5.2-3.4.12/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.5.2-3.4.12/api/scancode.zig b/castholm/v0.5.2-3.4.12/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.5.2-3.4.12/api/sensor.zig b/castholm/v0.5.2-3.4.12/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.5.2-3.4.12/api/stdinc.zig b/castholm/v0.5.2-3.4.12/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.5.2-3.4.12/api/storage.zig b/castholm/v0.5.2-3.4.12/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.5.2-3.4.12/api/surface.zig b/castholm/v0.5.2-3.4.12/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.5.2-3.4.12/api/system.zig b/castholm/v0.5.2-3.4.12/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.5.2-3.4.12/api/time.zig b/castholm/v0.5.2-3.4.12/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.5.2-3.4.12/api/timer.zig b/castholm/v0.5.2-3.4.12/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.5.2-3.4.12/api/touch.zig b/castholm/v0.5.2-3.4.12/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.5.2-3.4.12/api/tray.zig b/castholm/v0.5.2-3.4.12/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.5.2-3.4.12/api/version.zig b/castholm/v0.5.2-3.4.12/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.5.2-3.4.12/api/video.zig b/castholm/v0.5.2-3.4.12/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.5.2-3.4.12/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.5.2-3.4.12/json/audio.json b/castholm/v0.5.2-3.4.12/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/blendmode.json b/castholm/v0.5.2-3.4.12/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/camera.json b/castholm/v0.5.2-3.4.12/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/clipboard.json b/castholm/v0.5.2-3.4.12/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/dialog.json b/castholm/v0.5.2-3.4.12/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/endian.json b/castholm/v0.5.2-3.4.12/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/error.json b/castholm/v0.5.2-3.4.12/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/events.json b/castholm/v0.5.2-3.4.12/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/filesystem.json b/castholm/v0.5.2-3.4.12/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/gamepad.json b/castholm/v0.5.2-3.4.12/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/gpu.json b/castholm/v0.5.2-3.4.12/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/guid.json b/castholm/v0.5.2-3.4.12/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/haptic.json b/castholm/v0.5.2-3.4.12/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/hints.json b/castholm/v0.5.2-3.4.12/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/init.json b/castholm/v0.5.2-3.4.12/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/iostream.json b/castholm/v0.5.2-3.4.12/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/joystick.json b/castholm/v0.5.2-3.4.12/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/keyboard.json b/castholm/v0.5.2-3.4.12/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/keycode.json b/castholm/v0.5.2-3.4.12/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/loadso.json b/castholm/v0.5.2-3.4.12/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/messagebox.json b/castholm/v0.5.2-3.4.12/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/misc.json b/castholm/v0.5.2-3.4.12/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/mouse.json b/castholm/v0.5.2-3.4.12/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/opengl.json b/castholm/v0.5.2-3.4.12/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/pen.json b/castholm/v0.5.2-3.4.12/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/pixels.json b/castholm/v0.5.2-3.4.12/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/power.json b/castholm/v0.5.2-3.4.12/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/process.json b/castholm/v0.5.2-3.4.12/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/properties.json b/castholm/v0.5.2-3.4.12/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/rect.json b/castholm/v0.5.2-3.4.12/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/render.json b/castholm/v0.5.2-3.4.12/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/scancode.json b/castholm/v0.5.2-3.4.12/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/sensor.json b/castholm/v0.5.2-3.4.12/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/storage.json b/castholm/v0.5.2-3.4.12/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/surface.json b/castholm/v0.5.2-3.4.12/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/system.json b/castholm/v0.5.2-3.4.12/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/time.json b/castholm/v0.5.2-3.4.12/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/timer.json b/castholm/v0.5.2-3.4.12/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/touch.json b/castholm/v0.5.2-3.4.12/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/tray.json b/castholm/v0.5.2-3.4.12/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/version.json b/castholm/v0.5.2-3.4.12/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.2-3.4.12/json/video.json b/castholm/v0.5.2-3.4.12/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.5.2-3.4.12/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/api/audio.zig b/castholm/v0.5.3-3.4.14/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.5.3-3.4.14/api/blendmode.zig b/castholm/v0.5.3-3.4.14/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.5.3-3.4.14/api/c.zig b/castholm/v0.5.3-3.4.14/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.5.3-3.4.14/api/camera.zig b/castholm/v0.5.3-3.4.14/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.5.3-3.4.14/api/clipboard.zig b/castholm/v0.5.3-3.4.14/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.5.3-3.4.14/api/dialog.zig b/castholm/v0.5.3-3.4.14/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.5.3-3.4.14/api/endian.zig b/castholm/v0.5.3-3.4.14/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.3-3.4.14/api/error.zig b/castholm/v0.5.3-3.4.14/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.5.3-3.4.14/api/events.zig b/castholm/v0.5.3-3.4.14/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.5.3-3.4.14/api/filesystem.zig b/castholm/v0.5.3-3.4.14/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.5.3-3.4.14/api/gamepad.zig b/castholm/v0.5.3-3.4.14/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.5.3-3.4.14/api/gpu.zig b/castholm/v0.5.3-3.4.14/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.5.3-3.4.14/api/guid.zig b/castholm/v0.5.3-3.4.14/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.5.3-3.4.14/api/haptic.zig b/castholm/v0.5.3-3.4.14/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.5.3-3.4.14/api/hints.zig b/castholm/v0.5.3-3.4.14/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.5.3-3.4.14/api/init.zig b/castholm/v0.5.3-3.4.14/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.5.3-3.4.14/api/iostream.zig b/castholm/v0.5.3-3.4.14/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.5.3-3.4.14/api/joystick.zig b/castholm/v0.5.3-3.4.14/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.5.3-3.4.14/api/keyboard.zig b/castholm/v0.5.3-3.4.14/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.3-3.4.14/api/keycode.zig b/castholm/v0.5.3-3.4.14/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.5.3-3.4.14/api/loadso.zig b/castholm/v0.5.3-3.4.14/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.5.3-3.4.14/api/messagebox.zig b/castholm/v0.5.3-3.4.14/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.3-3.4.14/api/misc.zig b/castholm/v0.5.3-3.4.14/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.5.3-3.4.14/api/mouse.zig b/castholm/v0.5.3-3.4.14/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.5.3-3.4.14/api/opengl.zig b/castholm/v0.5.3-3.4.14/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.3-3.4.14/api/pen.zig b/castholm/v0.5.3-3.4.14/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.5.3-3.4.14/api/pixels.zig b/castholm/v0.5.3-3.4.14/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.5.3-3.4.14/api/power.zig b/castholm/v0.5.3-3.4.14/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.5.3-3.4.14/api/process.zig b/castholm/v0.5.3-3.4.14/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.5.3-3.4.14/api/properties.zig b/castholm/v0.5.3-3.4.14/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.5.3-3.4.14/api/rect.zig b/castholm/v0.5.3-3.4.14/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.5.3-3.4.14/api/render.zig b/castholm/v0.5.3-3.4.14/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.5.3-3.4.14/api/scancode.zig b/castholm/v0.5.3-3.4.14/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.5.3-3.4.14/api/sensor.zig b/castholm/v0.5.3-3.4.14/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.5.3-3.4.14/api/stdinc.zig b/castholm/v0.5.3-3.4.14/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.5.3-3.4.14/api/storage.zig b/castholm/v0.5.3-3.4.14/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.5.3-3.4.14/api/surface.zig b/castholm/v0.5.3-3.4.14/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.5.3-3.4.14/api/system.zig b/castholm/v0.5.3-3.4.14/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.5.3-3.4.14/api/time.zig b/castholm/v0.5.3-3.4.14/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.5.3-3.4.14/api/timer.zig b/castholm/v0.5.3-3.4.14/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.5.3-3.4.14/api/touch.zig b/castholm/v0.5.3-3.4.14/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.5.3-3.4.14/api/tray.zig b/castholm/v0.5.3-3.4.14/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.5.3-3.4.14/api/version.zig b/castholm/v0.5.3-3.4.14/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.5.3-3.4.14/api/video.zig b/castholm/v0.5.3-3.4.14/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.5.3-3.4.14/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.5.3-3.4.14/json/audio.json b/castholm/v0.5.3-3.4.14/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/blendmode.json b/castholm/v0.5.3-3.4.14/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/camera.json b/castholm/v0.5.3-3.4.14/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/clipboard.json b/castholm/v0.5.3-3.4.14/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/dialog.json b/castholm/v0.5.3-3.4.14/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/endian.json b/castholm/v0.5.3-3.4.14/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/error.json b/castholm/v0.5.3-3.4.14/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/events.json b/castholm/v0.5.3-3.4.14/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/filesystem.json b/castholm/v0.5.3-3.4.14/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/gamepad.json b/castholm/v0.5.3-3.4.14/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/gpu.json b/castholm/v0.5.3-3.4.14/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/guid.json b/castholm/v0.5.3-3.4.14/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/haptic.json b/castholm/v0.5.3-3.4.14/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/hints.json b/castholm/v0.5.3-3.4.14/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/init.json b/castholm/v0.5.3-3.4.14/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/iostream.json b/castholm/v0.5.3-3.4.14/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/joystick.json b/castholm/v0.5.3-3.4.14/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/keyboard.json b/castholm/v0.5.3-3.4.14/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/keycode.json b/castholm/v0.5.3-3.4.14/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/loadso.json b/castholm/v0.5.3-3.4.14/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/messagebox.json b/castholm/v0.5.3-3.4.14/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/misc.json b/castholm/v0.5.3-3.4.14/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/mouse.json b/castholm/v0.5.3-3.4.14/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/opengl.json b/castholm/v0.5.3-3.4.14/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/pen.json b/castholm/v0.5.3-3.4.14/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/pixels.json b/castholm/v0.5.3-3.4.14/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/power.json b/castholm/v0.5.3-3.4.14/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/process.json b/castholm/v0.5.3-3.4.14/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/properties.json b/castholm/v0.5.3-3.4.14/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/rect.json b/castholm/v0.5.3-3.4.14/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/render.json b/castholm/v0.5.3-3.4.14/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/scancode.json b/castholm/v0.5.3-3.4.14/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/sensor.json b/castholm/v0.5.3-3.4.14/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/storage.json b/castholm/v0.5.3-3.4.14/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/surface.json b/castholm/v0.5.3-3.4.14/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/system.json b/castholm/v0.5.3-3.4.14/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/time.json b/castholm/v0.5.3-3.4.14/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/timer.json b/castholm/v0.5.3-3.4.14/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/touch.json b/castholm/v0.5.3-3.4.14/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/tray.json b/castholm/v0.5.3-3.4.14/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/version.json b/castholm/v0.5.3-3.4.14/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.3-3.4.14/json/video.json b/castholm/v0.5.3-3.4.14/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.5.3-3.4.14/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/api/audio.zig b/castholm/v0.5.4-3.4.16/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.5.4-3.4.16/api/blendmode.zig b/castholm/v0.5.4-3.4.16/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.5.4-3.4.16/api/c.zig b/castholm/v0.5.4-3.4.16/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.5.4-3.4.16/api/camera.zig b/castholm/v0.5.4-3.4.16/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.5.4-3.4.16/api/clipboard.zig b/castholm/v0.5.4-3.4.16/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.5.4-3.4.16/api/dialog.zig b/castholm/v0.5.4-3.4.16/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.5.4-3.4.16/api/endian.zig b/castholm/v0.5.4-3.4.16/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.4-3.4.16/api/error.zig b/castholm/v0.5.4-3.4.16/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.5.4-3.4.16/api/events.zig b/castholm/v0.5.4-3.4.16/api/events.zig new file mode 100644 index 0000000..4896f63 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/events.zig @@ -0,0 +1,688 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.5.4-3.4.16/api/filesystem.zig b/castholm/v0.5.4-3.4.16/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.5.4-3.4.16/api/gamepad.zig b/castholm/v0.5.4-3.4.16/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.5.4-3.4.16/api/gpu.zig b/castholm/v0.5.4-3.4.16/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.5.4-3.4.16/api/guid.zig b/castholm/v0.5.4-3.4.16/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.5.4-3.4.16/api/haptic.zig b/castholm/v0.5.4-3.4.16/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.5.4-3.4.16/api/hints.zig b/castholm/v0.5.4-3.4.16/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.5.4-3.4.16/api/init.zig b/castholm/v0.5.4-3.4.16/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.5.4-3.4.16/api/iostream.zig b/castholm/v0.5.4-3.4.16/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.5.4-3.4.16/api/joystick.zig b/castholm/v0.5.4-3.4.16/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.5.4-3.4.16/api/keyboard.zig b/castholm/v0.5.4-3.4.16/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.4-3.4.16/api/keycode.zig b/castholm/v0.5.4-3.4.16/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.5.4-3.4.16/api/loadso.zig b/castholm/v0.5.4-3.4.16/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.5.4-3.4.16/api/messagebox.zig b/castholm/v0.5.4-3.4.16/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.5.4-3.4.16/api/misc.zig b/castholm/v0.5.4-3.4.16/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.5.4-3.4.16/api/mouse.zig b/castholm/v0.5.4-3.4.16/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.5.4-3.4.16/api/opengl.zig b/castholm/v0.5.4-3.4.16/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.5.4-3.4.16/api/pen.zig b/castholm/v0.5.4-3.4.16/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.5.4-3.4.16/api/pixels.zig b/castholm/v0.5.4-3.4.16/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.5.4-3.4.16/api/power.zig b/castholm/v0.5.4-3.4.16/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.5.4-3.4.16/api/process.zig b/castholm/v0.5.4-3.4.16/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.5.4-3.4.16/api/properties.zig b/castholm/v0.5.4-3.4.16/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.5.4-3.4.16/api/rect.zig b/castholm/v0.5.4-3.4.16/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.5.4-3.4.16/api/render.zig b/castholm/v0.5.4-3.4.16/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.5.4-3.4.16/api/scancode.zig b/castholm/v0.5.4-3.4.16/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.5.4-3.4.16/api/sensor.zig b/castholm/v0.5.4-3.4.16/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.5.4-3.4.16/api/stdinc.zig b/castholm/v0.5.4-3.4.16/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.5.4-3.4.16/api/storage.zig b/castholm/v0.5.4-3.4.16/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.5.4-3.4.16/api/surface.zig b/castholm/v0.5.4-3.4.16/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.5.4-3.4.16/api/system.zig b/castholm/v0.5.4-3.4.16/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.5.4-3.4.16/api/time.zig b/castholm/v0.5.4-3.4.16/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.5.4-3.4.16/api/timer.zig b/castholm/v0.5.4-3.4.16/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.5.4-3.4.16/api/touch.zig b/castholm/v0.5.4-3.4.16/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.5.4-3.4.16/api/tray.zig b/castholm/v0.5.4-3.4.16/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.5.4-3.4.16/api/version.zig b/castholm/v0.5.4-3.4.16/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.5.4-3.4.16/api/video.zig b/castholm/v0.5.4-3.4.16/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.5.4-3.4.16/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.5.4-3.4.16/json/audio.json b/castholm/v0.5.4-3.4.16/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/blendmode.json b/castholm/v0.5.4-3.4.16/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/camera.json b/castholm/v0.5.4-3.4.16/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/clipboard.json b/castholm/v0.5.4-3.4.16/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/dialog.json b/castholm/v0.5.4-3.4.16/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/endian.json b/castholm/v0.5.4-3.4.16/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/error.json b/castholm/v0.5.4-3.4.16/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/events.json b/castholm/v0.5.4-3.4.16/json/events.json new file mode 100644 index 0000000..2b0d9be --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/events.json @@ -0,0 +1,2534 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/filesystem.json b/castholm/v0.5.4-3.4.16/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/gamepad.json b/castholm/v0.5.4-3.4.16/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/gpu.json b/castholm/v0.5.4-3.4.16/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/guid.json b/castholm/v0.5.4-3.4.16/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/haptic.json b/castholm/v0.5.4-3.4.16/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/hints.json b/castholm/v0.5.4-3.4.16/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/init.json b/castholm/v0.5.4-3.4.16/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/iostream.json b/castholm/v0.5.4-3.4.16/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/joystick.json b/castholm/v0.5.4-3.4.16/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/keyboard.json b/castholm/v0.5.4-3.4.16/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/keycode.json b/castholm/v0.5.4-3.4.16/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/loadso.json b/castholm/v0.5.4-3.4.16/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/messagebox.json b/castholm/v0.5.4-3.4.16/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/misc.json b/castholm/v0.5.4-3.4.16/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/mouse.json b/castholm/v0.5.4-3.4.16/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/opengl.json b/castholm/v0.5.4-3.4.16/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/pen.json b/castholm/v0.5.4-3.4.16/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/pixels.json b/castholm/v0.5.4-3.4.16/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/power.json b/castholm/v0.5.4-3.4.16/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/process.json b/castholm/v0.5.4-3.4.16/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/properties.json b/castholm/v0.5.4-3.4.16/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/rect.json b/castholm/v0.5.4-3.4.16/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/render.json b/castholm/v0.5.4-3.4.16/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/scancode.json b/castholm/v0.5.4-3.4.16/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/sensor.json b/castholm/v0.5.4-3.4.16/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/storage.json b/castholm/v0.5.4-3.4.16/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/surface.json b/castholm/v0.5.4-3.4.16/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/system.json b/castholm/v0.5.4-3.4.16/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/time.json b/castholm/v0.5.4-3.4.16/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/timer.json b/castholm/v0.5.4-3.4.16/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/touch.json b/castholm/v0.5.4-3.4.16/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/tray.json b/castholm/v0.5.4-3.4.16/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/version.json b/castholm/v0.5.4-3.4.16/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.5.4-3.4.16/json/video.json b/castholm/v0.5.4-3.4.16/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.5.4-3.4.16/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/api/audio.zig b/castholm/v0.6.0-3.4.18/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.6.0-3.4.18/api/blendmode.zig b/castholm/v0.6.0-3.4.18/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.6.0-3.4.18/api/c.zig b/castholm/v0.6.0-3.4.18/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.6.0-3.4.18/api/camera.zig b/castholm/v0.6.0-3.4.18/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.6.0-3.4.18/api/clipboard.zig b/castholm/v0.6.0-3.4.18/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.6.0-3.4.18/api/dialog.zig b/castholm/v0.6.0-3.4.18/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.6.0-3.4.18/api/endian.zig b/castholm/v0.6.0-3.4.18/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.6.0-3.4.18/api/error.zig b/castholm/v0.6.0-3.4.18/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.6.0-3.4.18/api/events.zig b/castholm/v0.6.0-3.4.18/api/events.zig new file mode 100644 index 0000000..1ef11de --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/events.zig @@ -0,0 +1,694 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const PowerState = power_api.PowerState; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.6.0-3.4.18/api/filesystem.zig b/castholm/v0.6.0-3.4.18/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.6.0-3.4.18/api/gamepad.zig b/castholm/v0.6.0-3.4.18/api/gamepad.zig new file mode 100644 index 0000000..df56ca5 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/gamepad.zig @@ -0,0 +1,391 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeSteam, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.6.0-3.4.18/api/gpu.zig b/castholm/v0.6.0-3.4.18/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.6.0-3.4.18/api/guid.zig b/castholm/v0.6.0-3.4.18/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.6.0-3.4.18/api/haptic.zig b/castholm/v0.6.0-3.4.18/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.6.0-3.4.18/api/hints.zig b/castholm/v0.6.0-3.4.18/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.6.0-3.4.18/api/init.zig b/castholm/v0.6.0-3.4.18/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.6.0-3.4.18/api/iostream.zig b/castholm/v0.6.0-3.4.18/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.6.0-3.4.18/api/joystick.zig b/castholm/v0.6.0-3.4.18/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.6.0-3.4.18/api/keyboard.zig b/castholm/v0.6.0-3.4.18/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.6.0-3.4.18/api/keycode.zig b/castholm/v0.6.0-3.4.18/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.6.0-3.4.18/api/loadso.zig b/castholm/v0.6.0-3.4.18/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.6.0-3.4.18/api/messagebox.zig b/castholm/v0.6.0-3.4.18/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.6.0-3.4.18/api/misc.zig b/castholm/v0.6.0-3.4.18/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.6.0-3.4.18/api/mouse.zig b/castholm/v0.6.0-3.4.18/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.6.0-3.4.18/api/opengl.zig b/castholm/v0.6.0-3.4.18/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.6.0-3.4.18/api/pen.zig b/castholm/v0.6.0-3.4.18/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.6.0-3.4.18/api/pixels.zig b/castholm/v0.6.0-3.4.18/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.6.0-3.4.18/api/power.zig b/castholm/v0.6.0-3.4.18/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.6.0-3.4.18/api/process.zig b/castholm/v0.6.0-3.4.18/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.6.0-3.4.18/api/properties.zig b/castholm/v0.6.0-3.4.18/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.6.0-3.4.18/api/rect.zig b/castholm/v0.6.0-3.4.18/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.6.0-3.4.18/api/render.zig b/castholm/v0.6.0-3.4.18/api/render.zig new file mode 100644 index 0000000..5aaa13d --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/render.zig @@ -0,0 +1,554 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.6.0-3.4.18/api/scancode.zig b/castholm/v0.6.0-3.4.18/api/scancode.zig new file mode 100644 index 0000000..8430cc4 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/scancode.zig @@ -0,0 +1,254 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeFront = 165, //Front (Sun keyboards) + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.6.0-3.4.18/api/sensor.zig b/castholm/v0.6.0-3.4.18/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.6.0-3.4.18/api/stdinc.zig b/castholm/v0.6.0-3.4.18/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.6.0-3.4.18/api/storage.zig b/castholm/v0.6.0-3.4.18/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.6.0-3.4.18/api/surface.zig b/castholm/v0.6.0-3.4.18/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.6.0-3.4.18/api/system.zig b/castholm/v0.6.0-3.4.18/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.6.0-3.4.18/api/time.zig b/castholm/v0.6.0-3.4.18/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.6.0-3.4.18/api/timer.zig b/castholm/v0.6.0-3.4.18/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.6.0-3.4.18/api/touch.zig b/castholm/v0.6.0-3.4.18/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.6.0-3.4.18/api/tray.zig b/castholm/v0.6.0-3.4.18/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.6.0-3.4.18/api/version.zig b/castholm/v0.6.0-3.4.18/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.6.0-3.4.18/api/video.zig b/castholm/v0.6.0-3.4.18/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.6.0-3.4.18/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.6.0-3.4.18/json/audio.json b/castholm/v0.6.0-3.4.18/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/blendmode.json b/castholm/v0.6.0-3.4.18/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/camera.json b/castholm/v0.6.0-3.4.18/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/clipboard.json b/castholm/v0.6.0-3.4.18/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/dialog.json b/castholm/v0.6.0-3.4.18/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/endian.json b/castholm/v0.6.0-3.4.18/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/error.json b/castholm/v0.6.0-3.4.18/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/events.json b/castholm/v0.6.0-3.4.18/json/events.json new file mode 100644 index 0000000..c55f626 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/events.json @@ -0,0 +1,2559 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/filesystem.json b/castholm/v0.6.0-3.4.18/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/gamepad.json b/castholm/v0.6.0-3.4.18/json/gamepad.json new file mode 100644 index 0000000..374e4fe --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/gamepad.json @@ -0,0 +1,1172 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_STEAM" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/gpu.json b/castholm/v0.6.0-3.4.18/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/guid.json b/castholm/v0.6.0-3.4.18/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/haptic.json b/castholm/v0.6.0-3.4.18/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/hints.json b/castholm/v0.6.0-3.4.18/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/init.json b/castholm/v0.6.0-3.4.18/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/iostream.json b/castholm/v0.6.0-3.4.18/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/joystick.json b/castholm/v0.6.0-3.4.18/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/keyboard.json b/castholm/v0.6.0-3.4.18/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/keycode.json b/castholm/v0.6.0-3.4.18/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/loadso.json b/castholm/v0.6.0-3.4.18/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/messagebox.json b/castholm/v0.6.0-3.4.18/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/misc.json b/castholm/v0.6.0-3.4.18/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/mouse.json b/castholm/v0.6.0-3.4.18/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/opengl.json b/castholm/v0.6.0-3.4.18/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/pen.json b/castholm/v0.6.0-3.4.18/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/pixels.json b/castholm/v0.6.0-3.4.18/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/power.json b/castholm/v0.6.0-3.4.18/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/process.json b/castholm/v0.6.0-3.4.18/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/properties.json b/castholm/v0.6.0-3.4.18/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/rect.json b/castholm/v0.6.0-3.4.18/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/render.json b/castholm/v0.6.0-3.4.18/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/scancode.json b/castholm/v0.6.0-3.4.18/json/scancode.json new file mode 100644 index 0000000..e457ddd --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/scancode.json @@ -0,0 +1,1088 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_FRONT", + "value": "165", + "comment": "Front (Sun keyboards)" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/sensor.json b/castholm/v0.6.0-3.4.18/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/storage.json b/castholm/v0.6.0-3.4.18/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/surface.json b/castholm/v0.6.0-3.4.18/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/system.json b/castholm/v0.6.0-3.4.18/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/time.json b/castholm/v0.6.0-3.4.18/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/timer.json b/castholm/v0.6.0-3.4.18/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/touch.json b/castholm/v0.6.0-3.4.18/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/tray.json b/castholm/v0.6.0-3.4.18/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/version.json b/castholm/v0.6.0-3.4.18/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.0-3.4.18/json/video.json b/castholm/v0.6.0-3.4.18/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.6.0-3.4.18/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/api/audio.zig b/castholm/v0.6.1-3.4.20/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/castholm/v0.6.1-3.4.20/api/blendmode.zig b/castholm/v0.6.1-3.4.20/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/castholm/v0.6.1-3.4.20/api/c.zig b/castholm/v0.6.1-3.4.20/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/castholm/v0.6.1-3.4.20/api/camera.zig b/castholm/v0.6.1-3.4.20/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/castholm/v0.6.1-3.4.20/api/clipboard.zig b/castholm/v0.6.1-3.4.20/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/castholm/v0.6.1-3.4.20/api/dialog.zig b/castholm/v0.6.1-3.4.20/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/castholm/v0.6.1-3.4.20/api/endian.zig b/castholm/v0.6.1-3.4.20/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.6.1-3.4.20/api/error.zig b/castholm/v0.6.1-3.4.20/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/castholm/v0.6.1-3.4.20/api/events.zig b/castholm/v0.6.1-3.4.20/api/events.zig new file mode 100644 index 0000000..1ef11de --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/events.zig @@ -0,0 +1,694 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const PowerState = power_api.PowerState; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/castholm/v0.6.1-3.4.20/api/filesystem.zig b/castholm/v0.6.1-3.4.20/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/castholm/v0.6.1-3.4.20/api/gamepad.zig b/castholm/v0.6.1-3.4.20/api/gamepad.zig new file mode 100644 index 0000000..df56ca5 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/gamepad.zig @@ -0,0 +1,391 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeSteam, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/castholm/v0.6.1-3.4.20/api/gpu.zig b/castholm/v0.6.1-3.4.20/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/castholm/v0.6.1-3.4.20/api/guid.zig b/castholm/v0.6.1-3.4.20/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/castholm/v0.6.1-3.4.20/api/haptic.zig b/castholm/v0.6.1-3.4.20/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/castholm/v0.6.1-3.4.20/api/hints.zig b/castholm/v0.6.1-3.4.20/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/castholm/v0.6.1-3.4.20/api/init.zig b/castholm/v0.6.1-3.4.20/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/castholm/v0.6.1-3.4.20/api/iostream.zig b/castholm/v0.6.1-3.4.20/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/castholm/v0.6.1-3.4.20/api/joystick.zig b/castholm/v0.6.1-3.4.20/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/castholm/v0.6.1-3.4.20/api/keyboard.zig b/castholm/v0.6.1-3.4.20/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.6.1-3.4.20/api/keycode.zig b/castholm/v0.6.1-3.4.20/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/castholm/v0.6.1-3.4.20/api/loadso.zig b/castholm/v0.6.1-3.4.20/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/castholm/v0.6.1-3.4.20/api/messagebox.zig b/castholm/v0.6.1-3.4.20/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/castholm/v0.6.1-3.4.20/api/misc.zig b/castholm/v0.6.1-3.4.20/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/castholm/v0.6.1-3.4.20/api/mouse.zig b/castholm/v0.6.1-3.4.20/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/castholm/v0.6.1-3.4.20/api/opengl.zig b/castholm/v0.6.1-3.4.20/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/castholm/v0.6.1-3.4.20/api/pen.zig b/castholm/v0.6.1-3.4.20/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/castholm/v0.6.1-3.4.20/api/pixels.zig b/castholm/v0.6.1-3.4.20/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/castholm/v0.6.1-3.4.20/api/power.zig b/castholm/v0.6.1-3.4.20/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/castholm/v0.6.1-3.4.20/api/process.zig b/castholm/v0.6.1-3.4.20/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/castholm/v0.6.1-3.4.20/api/properties.zig b/castholm/v0.6.1-3.4.20/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/castholm/v0.6.1-3.4.20/api/rect.zig b/castholm/v0.6.1-3.4.20/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/castholm/v0.6.1-3.4.20/api/render.zig b/castholm/v0.6.1-3.4.20/api/render.zig new file mode 100644 index 0000000..5aaa13d --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/render.zig @@ -0,0 +1,554 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/castholm/v0.6.1-3.4.20/api/scancode.zig b/castholm/v0.6.1-3.4.20/api/scancode.zig new file mode 100644 index 0000000..8430cc4 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/scancode.zig @@ -0,0 +1,254 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeFront = 165, //Front (Sun keyboards) + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/castholm/v0.6.1-3.4.20/api/sensor.zig b/castholm/v0.6.1-3.4.20/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/castholm/v0.6.1-3.4.20/api/stdinc.zig b/castholm/v0.6.1-3.4.20/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/castholm/v0.6.1-3.4.20/api/storage.zig b/castholm/v0.6.1-3.4.20/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/castholm/v0.6.1-3.4.20/api/surface.zig b/castholm/v0.6.1-3.4.20/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/castholm/v0.6.1-3.4.20/api/system.zig b/castholm/v0.6.1-3.4.20/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/castholm/v0.6.1-3.4.20/api/time.zig b/castholm/v0.6.1-3.4.20/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/castholm/v0.6.1-3.4.20/api/timer.zig b/castholm/v0.6.1-3.4.20/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/castholm/v0.6.1-3.4.20/api/touch.zig b/castholm/v0.6.1-3.4.20/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/castholm/v0.6.1-3.4.20/api/tray.zig b/castholm/v0.6.1-3.4.20/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/castholm/v0.6.1-3.4.20/api/version.zig b/castholm/v0.6.1-3.4.20/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/castholm/v0.6.1-3.4.20/api/video.zig b/castholm/v0.6.1-3.4.20/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/castholm/v0.6.1-3.4.20/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/castholm/v0.6.1-3.4.20/json/audio.json b/castholm/v0.6.1-3.4.20/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/blendmode.json b/castholm/v0.6.1-3.4.20/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/camera.json b/castholm/v0.6.1-3.4.20/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/clipboard.json b/castholm/v0.6.1-3.4.20/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/dialog.json b/castholm/v0.6.1-3.4.20/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/endian.json b/castholm/v0.6.1-3.4.20/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/error.json b/castholm/v0.6.1-3.4.20/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/events.json b/castholm/v0.6.1-3.4.20/json/events.json new file mode 100644 index 0000000..c55f626 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/events.json @@ -0,0 +1,2559 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/filesystem.json b/castholm/v0.6.1-3.4.20/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/gamepad.json b/castholm/v0.6.1-3.4.20/json/gamepad.json new file mode 100644 index 0000000..374e4fe --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/gamepad.json @@ -0,0 +1,1172 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_STEAM" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/gpu.json b/castholm/v0.6.1-3.4.20/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/guid.json b/castholm/v0.6.1-3.4.20/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/haptic.json b/castholm/v0.6.1-3.4.20/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/hints.json b/castholm/v0.6.1-3.4.20/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/init.json b/castholm/v0.6.1-3.4.20/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/iostream.json b/castholm/v0.6.1-3.4.20/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/joystick.json b/castholm/v0.6.1-3.4.20/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/keyboard.json b/castholm/v0.6.1-3.4.20/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/keycode.json b/castholm/v0.6.1-3.4.20/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/loadso.json b/castholm/v0.6.1-3.4.20/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/messagebox.json b/castholm/v0.6.1-3.4.20/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/misc.json b/castholm/v0.6.1-3.4.20/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/mouse.json b/castholm/v0.6.1-3.4.20/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/opengl.json b/castholm/v0.6.1-3.4.20/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/pen.json b/castholm/v0.6.1-3.4.20/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/pixels.json b/castholm/v0.6.1-3.4.20/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/power.json b/castholm/v0.6.1-3.4.20/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/process.json b/castholm/v0.6.1-3.4.20/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/properties.json b/castholm/v0.6.1-3.4.20/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/rect.json b/castholm/v0.6.1-3.4.20/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/render.json b/castholm/v0.6.1-3.4.20/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/scancode.json b/castholm/v0.6.1-3.4.20/json/scancode.json new file mode 100644 index 0000000..e457ddd --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/scancode.json @@ -0,0 +1,1088 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_FRONT", + "value": "165", + "comment": "Front (Sun keyboards)" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/sensor.json b/castholm/v0.6.1-3.4.20/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/storage.json b/castholm/v0.6.1-3.4.20/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/surface.json b/castholm/v0.6.1-3.4.20/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/system.json b/castholm/v0.6.1-3.4.20/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/time.json b/castholm/v0.6.1-3.4.20/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/timer.json b/castholm/v0.6.1-3.4.20/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/touch.json b/castholm/v0.6.1-3.4.20/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/tray.json b/castholm/v0.6.1-3.4.20/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/version.json b/castholm/v0.6.1-3.4.20/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/castholm/v0.6.1-3.4.20/json/video.json b/castholm/v0.6.1-3.4.20/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/castholm/v0.6.1-3.4.20/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/api/audio.zig b/official/release-3.4.10/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.10/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.10/api/blendmode.zig b/official/release-3.4.10/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.10/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.10/api/c.zig b/official/release-3.4.10/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.10/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.10/api/camera.zig b/official/release-3.4.10/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.10/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.10/api/clipboard.zig b/official/release-3.4.10/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.10/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.10/api/dialog.zig b/official/release-3.4.10/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.10/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.10/api/endian.zig b/official/release-3.4.10/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.10/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.10/api/error.zig b/official/release-3.4.10/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.10/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.10/api/events.zig b/official/release-3.4.10/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/official/release-3.4.10/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.10/api/filesystem.zig b/official/release-3.4.10/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.10/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.10/api/gamepad.zig b/official/release-3.4.10/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/official/release-3.4.10/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.10/api/gpu.zig b/official/release-3.4.10/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.10/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.10/api/guid.zig b/official/release-3.4.10/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.10/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.10/api/haptic.zig b/official/release-3.4.10/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.10/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.10/api/hints.zig b/official/release-3.4.10/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.10/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.10/api/init.zig b/official/release-3.4.10/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.10/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.10/api/iostream.zig b/official/release-3.4.10/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.10/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.10/api/joystick.zig b/official/release-3.4.10/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.10/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.10/api/keyboard.zig b/official/release-3.4.10/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.10/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.10/api/keycode.zig b/official/release-3.4.10/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.10/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.10/api/loadso.zig b/official/release-3.4.10/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.10/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.10/api/messagebox.zig b/official/release-3.4.10/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.10/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.10/api/misc.zig b/official/release-3.4.10/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.10/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.10/api/mouse.zig b/official/release-3.4.10/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.10/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.10/api/opengl.zig b/official/release-3.4.10/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.10/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.10/api/pen.zig b/official/release-3.4.10/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.10/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.10/api/pixels.zig b/official/release-3.4.10/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.10/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.10/api/power.zig b/official/release-3.4.10/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.10/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.10/api/process.zig b/official/release-3.4.10/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.10/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.10/api/properties.zig b/official/release-3.4.10/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.10/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.10/api/rect.zig b/official/release-3.4.10/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.10/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.10/api/render.zig b/official/release-3.4.10/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.10/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.10/api/scancode.zig b/official/release-3.4.10/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.10/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.10/api/sensor.zig b/official/release-3.4.10/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.10/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.10/api/stdinc.zig b/official/release-3.4.10/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.10/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.10/api/storage.zig b/official/release-3.4.10/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.10/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.10/api/surface.zig b/official/release-3.4.10/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.10/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.10/api/system.zig b/official/release-3.4.10/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.10/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.10/api/time.zig b/official/release-3.4.10/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.10/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.10/api/timer.zig b/official/release-3.4.10/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.10/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.10/api/touch.zig b/official/release-3.4.10/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.10/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.10/api/tray.zig b/official/release-3.4.10/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.10/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.10/api/version.zig b/official/release-3.4.10/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.10/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.10/api/video.zig b/official/release-3.4.10/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.10/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.10/json/audio.json b/official/release-3.4.10/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.10/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/blendmode.json b/official/release-3.4.10/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.10/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/camera.json b/official/release-3.4.10/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.10/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/clipboard.json b/official/release-3.4.10/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.10/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/dialog.json b/official/release-3.4.10/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.10/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/endian.json b/official/release-3.4.10/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.10/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/error.json b/official/release-3.4.10/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.10/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/events.json b/official/release-3.4.10/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/official/release-3.4.10/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/filesystem.json b/official/release-3.4.10/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.10/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/gamepad.json b/official/release-3.4.10/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/official/release-3.4.10/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/gpu.json b/official/release-3.4.10/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.10/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/guid.json b/official/release-3.4.10/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.10/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/haptic.json b/official/release-3.4.10/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.10/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/hints.json b/official/release-3.4.10/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.10/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/init.json b/official/release-3.4.10/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.10/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/iostream.json b/official/release-3.4.10/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.10/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/joystick.json b/official/release-3.4.10/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.10/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/keyboard.json b/official/release-3.4.10/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.10/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/keycode.json b/official/release-3.4.10/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.10/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/loadso.json b/official/release-3.4.10/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.10/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/messagebox.json b/official/release-3.4.10/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.10/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/misc.json b/official/release-3.4.10/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.10/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/mouse.json b/official/release-3.4.10/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.10/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/opengl.json b/official/release-3.4.10/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.10/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/pen.json b/official/release-3.4.10/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.10/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/pixels.json b/official/release-3.4.10/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.10/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/power.json b/official/release-3.4.10/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.10/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/process.json b/official/release-3.4.10/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.10/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/properties.json b/official/release-3.4.10/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.10/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/rect.json b/official/release-3.4.10/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.10/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/render.json b/official/release-3.4.10/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.10/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/scancode.json b/official/release-3.4.10/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.10/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/sensor.json b/official/release-3.4.10/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.10/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/storage.json b/official/release-3.4.10/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.10/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/surface.json b/official/release-3.4.10/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.10/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/system.json b/official/release-3.4.10/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.10/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/time.json b/official/release-3.4.10/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.10/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/timer.json b/official/release-3.4.10/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.10/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/touch.json b/official/release-3.4.10/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.10/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/tray.json b/official/release-3.4.10/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.10/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/version.json b/official/release-3.4.10/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.10/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.10/json/video.json b/official/release-3.4.10/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.10/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/api/audio.zig b/official/release-3.4.12/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.12/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.12/api/blendmode.zig b/official/release-3.4.12/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.12/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.12/api/c.zig b/official/release-3.4.12/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.12/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.12/api/camera.zig b/official/release-3.4.12/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.12/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.12/api/clipboard.zig b/official/release-3.4.12/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.12/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.12/api/dialog.zig b/official/release-3.4.12/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.12/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.12/api/endian.zig b/official/release-3.4.12/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.12/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.12/api/error.zig b/official/release-3.4.12/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.12/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.12/api/events.zig b/official/release-3.4.12/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/official/release-3.4.12/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.12/api/filesystem.zig b/official/release-3.4.12/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.12/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.12/api/gamepad.zig b/official/release-3.4.12/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/official/release-3.4.12/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.12/api/gpu.zig b/official/release-3.4.12/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.12/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.12/api/guid.zig b/official/release-3.4.12/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.12/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.12/api/haptic.zig b/official/release-3.4.12/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.12/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.12/api/hints.zig b/official/release-3.4.12/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.12/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.12/api/init.zig b/official/release-3.4.12/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.12/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.12/api/iostream.zig b/official/release-3.4.12/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.12/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.12/api/joystick.zig b/official/release-3.4.12/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.12/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.12/api/keyboard.zig b/official/release-3.4.12/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.12/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.12/api/keycode.zig b/official/release-3.4.12/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.12/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.12/api/loadso.zig b/official/release-3.4.12/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.12/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.12/api/messagebox.zig b/official/release-3.4.12/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.12/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.12/api/misc.zig b/official/release-3.4.12/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.12/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.12/api/mouse.zig b/official/release-3.4.12/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.12/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.12/api/opengl.zig b/official/release-3.4.12/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.12/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.12/api/pen.zig b/official/release-3.4.12/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.12/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.12/api/pixels.zig b/official/release-3.4.12/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.12/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.12/api/power.zig b/official/release-3.4.12/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.12/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.12/api/process.zig b/official/release-3.4.12/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.12/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.12/api/properties.zig b/official/release-3.4.12/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.12/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.12/api/rect.zig b/official/release-3.4.12/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.12/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.12/api/render.zig b/official/release-3.4.12/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.12/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.12/api/scancode.zig b/official/release-3.4.12/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.12/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.12/api/sensor.zig b/official/release-3.4.12/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.12/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.12/api/stdinc.zig b/official/release-3.4.12/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.12/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.12/api/storage.zig b/official/release-3.4.12/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.12/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.12/api/surface.zig b/official/release-3.4.12/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.12/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.12/api/system.zig b/official/release-3.4.12/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.12/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.12/api/time.zig b/official/release-3.4.12/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.12/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.12/api/timer.zig b/official/release-3.4.12/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.12/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.12/api/touch.zig b/official/release-3.4.12/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.12/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.12/api/tray.zig b/official/release-3.4.12/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.12/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.12/api/version.zig b/official/release-3.4.12/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.12/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.12/api/video.zig b/official/release-3.4.12/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.12/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.12/json/audio.json b/official/release-3.4.12/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.12/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/blendmode.json b/official/release-3.4.12/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.12/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/camera.json b/official/release-3.4.12/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.12/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/clipboard.json b/official/release-3.4.12/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.12/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/dialog.json b/official/release-3.4.12/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.12/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/endian.json b/official/release-3.4.12/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.12/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/error.json b/official/release-3.4.12/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.12/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/events.json b/official/release-3.4.12/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/official/release-3.4.12/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/filesystem.json b/official/release-3.4.12/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.12/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/gamepad.json b/official/release-3.4.12/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/official/release-3.4.12/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/gpu.json b/official/release-3.4.12/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.12/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/guid.json b/official/release-3.4.12/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.12/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/haptic.json b/official/release-3.4.12/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.12/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/hints.json b/official/release-3.4.12/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.12/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/init.json b/official/release-3.4.12/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.12/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/iostream.json b/official/release-3.4.12/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.12/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/joystick.json b/official/release-3.4.12/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.12/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/keyboard.json b/official/release-3.4.12/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.12/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/keycode.json b/official/release-3.4.12/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.12/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/loadso.json b/official/release-3.4.12/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.12/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/messagebox.json b/official/release-3.4.12/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.12/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/misc.json b/official/release-3.4.12/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.12/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/mouse.json b/official/release-3.4.12/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.12/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/opengl.json b/official/release-3.4.12/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.12/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/pen.json b/official/release-3.4.12/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.12/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/pixels.json b/official/release-3.4.12/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.12/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/power.json b/official/release-3.4.12/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.12/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/process.json b/official/release-3.4.12/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.12/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/properties.json b/official/release-3.4.12/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.12/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/rect.json b/official/release-3.4.12/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.12/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/render.json b/official/release-3.4.12/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.12/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/scancode.json b/official/release-3.4.12/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.12/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/sensor.json b/official/release-3.4.12/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.12/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/storage.json b/official/release-3.4.12/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.12/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/surface.json b/official/release-3.4.12/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.12/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/system.json b/official/release-3.4.12/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.12/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/time.json b/official/release-3.4.12/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.12/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/timer.json b/official/release-3.4.12/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.12/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/touch.json b/official/release-3.4.12/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.12/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/tray.json b/official/release-3.4.12/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.12/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/version.json b/official/release-3.4.12/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.12/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.12/json/video.json b/official/release-3.4.12/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.12/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/api/audio.zig b/official/release-3.4.14/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.14/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.14/api/blendmode.zig b/official/release-3.4.14/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.14/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.14/api/c.zig b/official/release-3.4.14/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.14/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.14/api/camera.zig b/official/release-3.4.14/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.14/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.14/api/clipboard.zig b/official/release-3.4.14/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.14/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.14/api/dialog.zig b/official/release-3.4.14/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.14/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.14/api/endian.zig b/official/release-3.4.14/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.14/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.14/api/error.zig b/official/release-3.4.14/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.14/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.14/api/events.zig b/official/release-3.4.14/api/events.zig new file mode 100644 index 0000000..26e9964 --- /dev/null +++ b/official/release-3.4.14/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.14/api/filesystem.zig b/official/release-3.4.14/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.14/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.14/api/gamepad.zig b/official/release-3.4.14/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/official/release-3.4.14/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.14/api/gpu.zig b/official/release-3.4.14/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.14/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.14/api/guid.zig b/official/release-3.4.14/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.14/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.14/api/haptic.zig b/official/release-3.4.14/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.14/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.14/api/hints.zig b/official/release-3.4.14/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.14/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.14/api/init.zig b/official/release-3.4.14/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.14/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.14/api/iostream.zig b/official/release-3.4.14/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.14/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.14/api/joystick.zig b/official/release-3.4.14/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.14/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.14/api/keyboard.zig b/official/release-3.4.14/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.14/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.14/api/keycode.zig b/official/release-3.4.14/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.14/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.14/api/loadso.zig b/official/release-3.4.14/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.14/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.14/api/messagebox.zig b/official/release-3.4.14/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.14/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.14/api/misc.zig b/official/release-3.4.14/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.14/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.14/api/mouse.zig b/official/release-3.4.14/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.14/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.14/api/opengl.zig b/official/release-3.4.14/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.14/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.14/api/pen.zig b/official/release-3.4.14/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.14/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.14/api/pixels.zig b/official/release-3.4.14/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.14/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.14/api/power.zig b/official/release-3.4.14/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.14/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.14/api/process.zig b/official/release-3.4.14/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.14/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.14/api/properties.zig b/official/release-3.4.14/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.14/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.14/api/rect.zig b/official/release-3.4.14/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.14/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.14/api/render.zig b/official/release-3.4.14/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.14/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.14/api/scancode.zig b/official/release-3.4.14/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.14/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.14/api/sensor.zig b/official/release-3.4.14/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.14/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.14/api/stdinc.zig b/official/release-3.4.14/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.14/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.14/api/storage.zig b/official/release-3.4.14/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.14/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.14/api/surface.zig b/official/release-3.4.14/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.14/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.14/api/system.zig b/official/release-3.4.14/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.14/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.14/api/time.zig b/official/release-3.4.14/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.14/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.14/api/timer.zig b/official/release-3.4.14/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.14/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.14/api/touch.zig b/official/release-3.4.14/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.14/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.14/api/tray.zig b/official/release-3.4.14/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.14/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.14/api/version.zig b/official/release-3.4.14/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.14/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.14/api/video.zig b/official/release-3.4.14/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.14/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.14/json/audio.json b/official/release-3.4.14/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.14/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/blendmode.json b/official/release-3.4.14/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.14/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/camera.json b/official/release-3.4.14/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.14/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/clipboard.json b/official/release-3.4.14/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.14/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/dialog.json b/official/release-3.4.14/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.14/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/endian.json b/official/release-3.4.14/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.14/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/error.json b/official/release-3.4.14/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.14/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/events.json b/official/release-3.4.14/json/events.json new file mode 100644 index 0000000..e82f5fa --- /dev/null +++ b/official/release-3.4.14/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/filesystem.json b/official/release-3.4.14/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.14/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/gamepad.json b/official/release-3.4.14/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/official/release-3.4.14/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/gpu.json b/official/release-3.4.14/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.14/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/guid.json b/official/release-3.4.14/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.14/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/haptic.json b/official/release-3.4.14/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.14/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/hints.json b/official/release-3.4.14/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.14/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/init.json b/official/release-3.4.14/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.14/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/iostream.json b/official/release-3.4.14/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.14/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/joystick.json b/official/release-3.4.14/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.14/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/keyboard.json b/official/release-3.4.14/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.14/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/keycode.json b/official/release-3.4.14/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.14/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/loadso.json b/official/release-3.4.14/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.14/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/messagebox.json b/official/release-3.4.14/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.14/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/misc.json b/official/release-3.4.14/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.14/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/mouse.json b/official/release-3.4.14/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.14/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/opengl.json b/official/release-3.4.14/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.14/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/pen.json b/official/release-3.4.14/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.14/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/pixels.json b/official/release-3.4.14/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.14/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/power.json b/official/release-3.4.14/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.14/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/process.json b/official/release-3.4.14/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.14/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/properties.json b/official/release-3.4.14/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.14/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/rect.json b/official/release-3.4.14/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.14/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/render.json b/official/release-3.4.14/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.14/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/scancode.json b/official/release-3.4.14/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.14/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/sensor.json b/official/release-3.4.14/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.14/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/storage.json b/official/release-3.4.14/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.14/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/surface.json b/official/release-3.4.14/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.14/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/system.json b/official/release-3.4.14/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.14/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/time.json b/official/release-3.4.14/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.14/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/timer.json b/official/release-3.4.14/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.14/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/touch.json b/official/release-3.4.14/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.14/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/tray.json b/official/release-3.4.14/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.14/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/version.json b/official/release-3.4.14/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.14/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.14/json/video.json b/official/release-3.4.14/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.14/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/api/audio.zig b/official/release-3.4.16/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.16/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.16/api/blendmode.zig b/official/release-3.4.16/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.16/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.16/api/c.zig b/official/release-3.4.16/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.16/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.16/api/camera.zig b/official/release-3.4.16/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.16/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.16/api/clipboard.zig b/official/release-3.4.16/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.16/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.16/api/dialog.zig b/official/release-3.4.16/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.16/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.16/api/endian.zig b/official/release-3.4.16/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.16/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.16/api/error.zig b/official/release-3.4.16/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.16/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.16/api/events.zig b/official/release-3.4.16/api/events.zig new file mode 100644 index 0000000..4896f63 --- /dev/null +++ b/official/release-3.4.16/api/events.zig @@ -0,0 +1,688 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.16/api/filesystem.zig b/official/release-3.4.16/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.16/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.16/api/gamepad.zig b/official/release-3.4.16/api/gamepad.zig new file mode 100644 index 0000000..1091dfa --- /dev/null +++ b/official/release-3.4.16/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.16/api/gpu.zig b/official/release-3.4.16/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.16/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.16/api/guid.zig b/official/release-3.4.16/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.16/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.16/api/haptic.zig b/official/release-3.4.16/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.16/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.16/api/hints.zig b/official/release-3.4.16/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.16/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.16/api/init.zig b/official/release-3.4.16/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.16/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.16/api/iostream.zig b/official/release-3.4.16/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.16/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.16/api/joystick.zig b/official/release-3.4.16/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.16/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.16/api/keyboard.zig b/official/release-3.4.16/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.16/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.16/api/keycode.zig b/official/release-3.4.16/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.16/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.16/api/loadso.zig b/official/release-3.4.16/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.16/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.16/api/messagebox.zig b/official/release-3.4.16/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.16/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.16/api/misc.zig b/official/release-3.4.16/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.16/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.16/api/mouse.zig b/official/release-3.4.16/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.16/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.16/api/opengl.zig b/official/release-3.4.16/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.16/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.16/api/pen.zig b/official/release-3.4.16/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.16/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.16/api/pixels.zig b/official/release-3.4.16/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.16/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.16/api/power.zig b/official/release-3.4.16/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.16/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.16/api/process.zig b/official/release-3.4.16/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.16/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.16/api/properties.zig b/official/release-3.4.16/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.16/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.16/api/rect.zig b/official/release-3.4.16/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.16/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.16/api/render.zig b/official/release-3.4.16/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.16/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.16/api/scancode.zig b/official/release-3.4.16/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.16/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.16/api/sensor.zig b/official/release-3.4.16/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.16/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.16/api/stdinc.zig b/official/release-3.4.16/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.16/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.16/api/storage.zig b/official/release-3.4.16/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.16/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.16/api/surface.zig b/official/release-3.4.16/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.16/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.16/api/system.zig b/official/release-3.4.16/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.16/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.16/api/time.zig b/official/release-3.4.16/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.16/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.16/api/timer.zig b/official/release-3.4.16/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.16/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.16/api/touch.zig b/official/release-3.4.16/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.16/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.16/api/tray.zig b/official/release-3.4.16/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.16/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.16/api/version.zig b/official/release-3.4.16/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.16/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.16/api/video.zig b/official/release-3.4.16/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.16/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.16/json/audio.json b/official/release-3.4.16/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.16/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/blendmode.json b/official/release-3.4.16/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.16/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/camera.json b/official/release-3.4.16/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.16/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/clipboard.json b/official/release-3.4.16/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.16/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/dialog.json b/official/release-3.4.16/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.16/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/endian.json b/official/release-3.4.16/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.16/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/error.json b/official/release-3.4.16/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.16/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/events.json b/official/release-3.4.16/json/events.json new file mode 100644 index 0000000..2b0d9be --- /dev/null +++ b/official/release-3.4.16/json/events.json @@ -0,0 +1,2534 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/filesystem.json b/official/release-3.4.16/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.16/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/gamepad.json b/official/release-3.4.16/json/gamepad.json new file mode 100644 index 0000000..bdcc9cb --- /dev/null +++ b/official/release-3.4.16/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/gpu.json b/official/release-3.4.16/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.16/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/guid.json b/official/release-3.4.16/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.16/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/haptic.json b/official/release-3.4.16/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.16/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/hints.json b/official/release-3.4.16/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.16/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/init.json b/official/release-3.4.16/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.16/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/iostream.json b/official/release-3.4.16/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.16/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/joystick.json b/official/release-3.4.16/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.16/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/keyboard.json b/official/release-3.4.16/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.16/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/keycode.json b/official/release-3.4.16/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.16/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/loadso.json b/official/release-3.4.16/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.16/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/messagebox.json b/official/release-3.4.16/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.16/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/misc.json b/official/release-3.4.16/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.16/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/mouse.json b/official/release-3.4.16/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.16/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/opengl.json b/official/release-3.4.16/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.16/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/pen.json b/official/release-3.4.16/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.16/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/pixels.json b/official/release-3.4.16/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.16/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/power.json b/official/release-3.4.16/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.16/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/process.json b/official/release-3.4.16/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.16/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/properties.json b/official/release-3.4.16/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.16/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/rect.json b/official/release-3.4.16/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.16/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/render.json b/official/release-3.4.16/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.16/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/scancode.json b/official/release-3.4.16/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.16/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/sensor.json b/official/release-3.4.16/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.16/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/storage.json b/official/release-3.4.16/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.16/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/surface.json b/official/release-3.4.16/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.16/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/system.json b/official/release-3.4.16/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.16/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/time.json b/official/release-3.4.16/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.16/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/timer.json b/official/release-3.4.16/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.16/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/touch.json b/official/release-3.4.16/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.16/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/tray.json b/official/release-3.4.16/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.16/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/version.json b/official/release-3.4.16/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.16/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.16/json/video.json b/official/release-3.4.16/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.16/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/api/audio.zig b/official/release-3.4.18/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.18/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.18/api/blendmode.zig b/official/release-3.4.18/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.18/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.18/api/c.zig b/official/release-3.4.18/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.18/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.18/api/camera.zig b/official/release-3.4.18/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.18/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.18/api/clipboard.zig b/official/release-3.4.18/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.18/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.18/api/dialog.zig b/official/release-3.4.18/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.18/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.18/api/endian.zig b/official/release-3.4.18/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.18/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.18/api/error.zig b/official/release-3.4.18/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.18/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.18/api/events.zig b/official/release-3.4.18/api/events.zig new file mode 100644 index 0000000..1ef11de --- /dev/null +++ b/official/release-3.4.18/api/events.zig @@ -0,0 +1,694 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const PowerState = power_api.PowerState; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.18/api/filesystem.zig b/official/release-3.4.18/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.18/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.18/api/gamepad.zig b/official/release-3.4.18/api/gamepad.zig new file mode 100644 index 0000000..df56ca5 --- /dev/null +++ b/official/release-3.4.18/api/gamepad.zig @@ -0,0 +1,391 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeSteam, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.18/api/gpu.zig b/official/release-3.4.18/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.18/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.18/api/guid.zig b/official/release-3.4.18/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.18/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.18/api/haptic.zig b/official/release-3.4.18/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.18/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.18/api/hints.zig b/official/release-3.4.18/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.18/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.18/api/init.zig b/official/release-3.4.18/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.18/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.18/api/iostream.zig b/official/release-3.4.18/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.18/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.18/api/joystick.zig b/official/release-3.4.18/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.18/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.18/api/keyboard.zig b/official/release-3.4.18/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.18/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.18/api/keycode.zig b/official/release-3.4.18/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.18/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.18/api/loadso.zig b/official/release-3.4.18/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.18/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.18/api/messagebox.zig b/official/release-3.4.18/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.18/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.18/api/misc.zig b/official/release-3.4.18/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.18/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.18/api/mouse.zig b/official/release-3.4.18/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.18/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.18/api/opengl.zig b/official/release-3.4.18/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.18/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.18/api/pen.zig b/official/release-3.4.18/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.18/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.18/api/pixels.zig b/official/release-3.4.18/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.18/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.18/api/power.zig b/official/release-3.4.18/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.18/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.18/api/process.zig b/official/release-3.4.18/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.18/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.18/api/properties.zig b/official/release-3.4.18/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.18/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.18/api/rect.zig b/official/release-3.4.18/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.18/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.18/api/render.zig b/official/release-3.4.18/api/render.zig new file mode 100644 index 0000000..5aaa13d --- /dev/null +++ b/official/release-3.4.18/api/render.zig @@ -0,0 +1,554 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.18/api/scancode.zig b/official/release-3.4.18/api/scancode.zig new file mode 100644 index 0000000..8430cc4 --- /dev/null +++ b/official/release-3.4.18/api/scancode.zig @@ -0,0 +1,254 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeFront = 165, //Front (Sun keyboards) + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.18/api/sensor.zig b/official/release-3.4.18/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.18/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.18/api/stdinc.zig b/official/release-3.4.18/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.18/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.18/api/storage.zig b/official/release-3.4.18/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.18/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.18/api/surface.zig b/official/release-3.4.18/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.18/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.18/api/system.zig b/official/release-3.4.18/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.18/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.18/api/time.zig b/official/release-3.4.18/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.18/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.18/api/timer.zig b/official/release-3.4.18/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.18/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.18/api/touch.zig b/official/release-3.4.18/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.18/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.18/api/tray.zig b/official/release-3.4.18/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.18/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.18/api/version.zig b/official/release-3.4.18/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.18/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.18/api/video.zig b/official/release-3.4.18/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.18/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.18/json/audio.json b/official/release-3.4.18/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.18/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/blendmode.json b/official/release-3.4.18/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.18/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/camera.json b/official/release-3.4.18/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.18/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/clipboard.json b/official/release-3.4.18/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.18/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/dialog.json b/official/release-3.4.18/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.18/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/endian.json b/official/release-3.4.18/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.18/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/error.json b/official/release-3.4.18/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.18/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/events.json b/official/release-3.4.18/json/events.json new file mode 100644 index 0000000..c55f626 --- /dev/null +++ b/official/release-3.4.18/json/events.json @@ -0,0 +1,2559 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/filesystem.json b/official/release-3.4.18/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.18/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/gamepad.json b/official/release-3.4.18/json/gamepad.json new file mode 100644 index 0000000..374e4fe --- /dev/null +++ b/official/release-3.4.18/json/gamepad.json @@ -0,0 +1,1172 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_STEAM" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/gpu.json b/official/release-3.4.18/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.18/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/guid.json b/official/release-3.4.18/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.18/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/haptic.json b/official/release-3.4.18/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.18/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/hints.json b/official/release-3.4.18/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.18/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/init.json b/official/release-3.4.18/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.18/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/iostream.json b/official/release-3.4.18/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.18/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/joystick.json b/official/release-3.4.18/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.18/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/keyboard.json b/official/release-3.4.18/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.18/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/keycode.json b/official/release-3.4.18/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.18/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/loadso.json b/official/release-3.4.18/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.18/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/messagebox.json b/official/release-3.4.18/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.18/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/misc.json b/official/release-3.4.18/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.18/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/mouse.json b/official/release-3.4.18/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.18/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/opengl.json b/official/release-3.4.18/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.18/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/pen.json b/official/release-3.4.18/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.18/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/pixels.json b/official/release-3.4.18/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.18/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/power.json b/official/release-3.4.18/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.18/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/process.json b/official/release-3.4.18/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.18/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/properties.json b/official/release-3.4.18/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.18/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/rect.json b/official/release-3.4.18/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.18/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/render.json b/official/release-3.4.18/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.18/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/scancode.json b/official/release-3.4.18/json/scancode.json new file mode 100644 index 0000000..e457ddd --- /dev/null +++ b/official/release-3.4.18/json/scancode.json @@ -0,0 +1,1088 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_FRONT", + "value": "165", + "comment": "Front (Sun keyboards)" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/sensor.json b/official/release-3.4.18/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.18/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/storage.json b/official/release-3.4.18/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.18/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/surface.json b/official/release-3.4.18/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.18/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/system.json b/official/release-3.4.18/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.18/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/time.json b/official/release-3.4.18/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.18/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/timer.json b/official/release-3.4.18/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.18/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/touch.json b/official/release-3.4.18/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.18/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/tray.json b/official/release-3.4.18/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.18/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/version.json b/official/release-3.4.18/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.18/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.18/json/video.json b/official/release-3.4.18/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.18/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/api/audio.zig b/official/release-3.4.2/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.2/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.2/api/blendmode.zig b/official/release-3.4.2/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.2/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.2/api/c.zig b/official/release-3.4.2/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.2/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.2/api/camera.zig b/official/release-3.4.2/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.2/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.2/api/clipboard.zig b/official/release-3.4.2/api/clipboard.zig new file mode 100644 index 0000000..6fe8270 --- /dev/null +++ b/official/release-3.4.2/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.2/api/dialog.zig b/official/release-3.4.2/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.2/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.2/api/endian.zig b/official/release-3.4.2/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.2/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.2/api/error.zig b/official/release-3.4.2/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.2/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.2/api/events.zig b/official/release-3.4.2/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/official/release-3.4.2/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.2/api/filesystem.zig b/official/release-3.4.2/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.2/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.2/api/gamepad.zig b/official/release-3.4.2/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/official/release-3.4.2/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.2/api/gpu.zig b/official/release-3.4.2/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.2/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.2/api/guid.zig b/official/release-3.4.2/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.2/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.2/api/haptic.zig b/official/release-3.4.2/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.2/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.2/api/hints.zig b/official/release-3.4.2/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.2/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.2/api/init.zig b/official/release-3.4.2/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.2/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.2/api/iostream.zig b/official/release-3.4.2/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.2/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.2/api/joystick.zig b/official/release-3.4.2/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.2/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.2/api/keyboard.zig b/official/release-3.4.2/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.2/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.2/api/keycode.zig b/official/release-3.4.2/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.2/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.2/api/loadso.zig b/official/release-3.4.2/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.2/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.2/api/messagebox.zig b/official/release-3.4.2/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.2/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.2/api/misc.zig b/official/release-3.4.2/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.2/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.2/api/mouse.zig b/official/release-3.4.2/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.2/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.2/api/opengl.zig b/official/release-3.4.2/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.2/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.2/api/pen.zig b/official/release-3.4.2/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.2/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.2/api/pixels.zig b/official/release-3.4.2/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.2/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.2/api/power.zig b/official/release-3.4.2/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.2/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.2/api/process.zig b/official/release-3.4.2/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.2/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.2/api/properties.zig b/official/release-3.4.2/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.2/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.2/api/rect.zig b/official/release-3.4.2/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.2/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.2/api/render.zig b/official/release-3.4.2/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.2/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.2/api/scancode.zig b/official/release-3.4.2/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.2/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.2/api/sensor.zig b/official/release-3.4.2/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.2/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.2/api/stdinc.zig b/official/release-3.4.2/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.2/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.2/api/storage.zig b/official/release-3.4.2/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.2/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.2/api/surface.zig b/official/release-3.4.2/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.2/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.2/api/system.zig b/official/release-3.4.2/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.2/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.2/api/time.zig b/official/release-3.4.2/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.2/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.2/api/timer.zig b/official/release-3.4.2/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.2/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.2/api/touch.zig b/official/release-3.4.2/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.2/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.2/api/tray.zig b/official/release-3.4.2/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.2/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.2/api/version.zig b/official/release-3.4.2/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.2/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.2/api/video.zig b/official/release-3.4.2/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.2/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.2/json/audio.json b/official/release-3.4.2/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.2/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/blendmode.json b/official/release-3.4.2/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.2/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/camera.json b/official/release-3.4.2/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.2/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/clipboard.json b/official/release-3.4.2/json/clipboard.json new file mode 100644 index 0000000..53889c5 --- /dev/null +++ b/official/release-3.4.2/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char **" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/dialog.json b/official/release-3.4.2/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.2/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/endian.json b/official/release-3.4.2/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.2/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/error.json b/official/release-3.4.2/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.2/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/events.json b/official/release-3.4.2/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/official/release-3.4.2/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/filesystem.json b/official/release-3.4.2/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.2/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/gamepad.json b/official/release-3.4.2/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/official/release-3.4.2/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/gpu.json b/official/release-3.4.2/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.2/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/guid.json b/official/release-3.4.2/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.2/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/haptic.json b/official/release-3.4.2/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.2/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/hints.json b/official/release-3.4.2/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.2/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/init.json b/official/release-3.4.2/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.2/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/iostream.json b/official/release-3.4.2/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.2/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/joystick.json b/official/release-3.4.2/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.2/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/keyboard.json b/official/release-3.4.2/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.2/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/keycode.json b/official/release-3.4.2/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.2/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/loadso.json b/official/release-3.4.2/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.2/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/messagebox.json b/official/release-3.4.2/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.2/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/misc.json b/official/release-3.4.2/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.2/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/mouse.json b/official/release-3.4.2/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.2/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/opengl.json b/official/release-3.4.2/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.2/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/pen.json b/official/release-3.4.2/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.2/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/pixels.json b/official/release-3.4.2/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.2/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/power.json b/official/release-3.4.2/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.2/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/process.json b/official/release-3.4.2/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.2/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/properties.json b/official/release-3.4.2/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.2/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/rect.json b/official/release-3.4.2/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.2/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/render.json b/official/release-3.4.2/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.2/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/scancode.json b/official/release-3.4.2/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.2/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/sensor.json b/official/release-3.4.2/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.2/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/storage.json b/official/release-3.4.2/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.2/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/surface.json b/official/release-3.4.2/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.2/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/system.json b/official/release-3.4.2/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.2/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/time.json b/official/release-3.4.2/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.2/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/timer.json b/official/release-3.4.2/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.2/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/touch.json b/official/release-3.4.2/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.2/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/tray.json b/official/release-3.4.2/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.2/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/version.json b/official/release-3.4.2/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.2/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.2/json/video.json b/official/release-3.4.2/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.2/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/api/audio.zig b/official/release-3.4.20/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.20/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.20/api/blendmode.zig b/official/release-3.4.20/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.20/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.20/api/c.zig b/official/release-3.4.20/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.20/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.20/api/camera.zig b/official/release-3.4.20/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.20/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.20/api/clipboard.zig b/official/release-3.4.20/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.20/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.20/api/dialog.zig b/official/release-3.4.20/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.20/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.20/api/endian.zig b/official/release-3.4.20/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.20/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.20/api/error.zig b/official/release-3.4.20/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.20/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.20/api/events.zig b/official/release-3.4.20/api/events.zig new file mode 100644 index 0000000..1ef11de --- /dev/null +++ b/official/release-3.4.20/api/events.zig @@ -0,0 +1,694 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const PowerState = power_api.PowerState; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event (added in 3.4.16). + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis + device_type: PenDeviceType, // the device type of the pen, if known (added in 3.4.18). +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.20/api/filesystem.zig b/official/release-3.4.20/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.20/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.20/api/gamepad.zig b/official/release-3.4.20/api/gamepad.zig new file mode 100644 index 0000000..df56ca5 --- /dev/null +++ b/official/release-3.4.20/api/gamepad.zig @@ -0,0 +1,391 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeSteam, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.20/api/gpu.zig b/official/release-3.4.20/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.20/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.20/api/guid.zig b/official/release-3.4.20/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.20/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.20/api/haptic.zig b/official/release-3.4.20/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.20/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.20/api/hints.zig b/official/release-3.4.20/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.20/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.20/api/init.zig b/official/release-3.4.20/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.20/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.20/api/iostream.zig b/official/release-3.4.20/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.20/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.20/api/joystick.zig b/official/release-3.4.20/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.20/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.20/api/keyboard.zig b/official/release-3.4.20/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.20/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.20/api/keycode.zig b/official/release-3.4.20/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.20/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.20/api/loadso.zig b/official/release-3.4.20/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.20/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.20/api/messagebox.zig b/official/release-3.4.20/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.20/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.20/api/misc.zig b/official/release-3.4.20/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.20/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.20/api/mouse.zig b/official/release-3.4.20/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.20/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.20/api/opengl.zig b/official/release-3.4.20/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.20/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.20/api/pen.zig b/official/release-3.4.20/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.20/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.20/api/pixels.zig b/official/release-3.4.20/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.20/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.20/api/power.zig b/official/release-3.4.20/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.20/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.20/api/process.zig b/official/release-3.4.20/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.20/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.20/api/properties.zig b/official/release-3.4.20/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.20/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.20/api/rect.zig b/official/release-3.4.20/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.20/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.20/api/render.zig b/official/release-3.4.20/api/render.zig new file mode 100644 index 0000000..5aaa13d --- /dev/null +++ b/official/release-3.4.20/api/render.zig @@ -0,0 +1,554 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenDeviceType = pen_api.PenDeviceType; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.20/api/scancode.zig b/official/release-3.4.20/api/scancode.zig new file mode 100644 index 0000000..8430cc4 --- /dev/null +++ b/official/release-3.4.20/api/scancode.zig @@ -0,0 +1,254 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeFront = 165, //Front (Sun keyboards) + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.20/api/sensor.zig b/official/release-3.4.20/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.20/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.20/api/stdinc.zig b/official/release-3.4.20/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.20/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.20/api/storage.zig b/official/release-3.4.20/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.20/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.20/api/surface.zig b/official/release-3.4.20/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.20/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.20/api/system.zig b/official/release-3.4.20/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.20/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.20/api/time.zig b/official/release-3.4.20/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.20/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.20/api/timer.zig b/official/release-3.4.20/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.20/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.20/api/touch.zig b/official/release-3.4.20/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.20/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.20/api/tray.zig b/official/release-3.4.20/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.20/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.20/api/version.zig b/official/release-3.4.20/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.20/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.20/api/video.zig b/official/release-3.4.20/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.20/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.20/json/audio.json b/official/release-3.4.20/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.20/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/blendmode.json b/official/release-3.4.20/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.20/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/camera.json b/official/release-3.4.20/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.20/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/clipboard.json b/official/release-3.4.20/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.20/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/dialog.json b/official/release-3.4.20/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.20/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/endian.json b/official/release-3.4.20/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.20/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/error.json b/official/release-3.4.20/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.20/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/events.json b/official/release-3.4.20/json/events.json new file mode 100644 index 0000000..c55f626 --- /dev/null +++ b/official/release-3.4.20/json/events.json @@ -0,0 +1,2559 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, SDL_PEN_MOUSEID for pen events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event (added in 3.4.16)." + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + }, + { + "name": "device_type", + "type": "SDL_PenDeviceType", + "comment": "the device type of the pen, if known (added in 3.4.18)." + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/filesystem.json b/official/release-3.4.20/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.20/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/gamepad.json b/official/release-3.4.20/json/gamepad.json new file mode 100644 index 0000000..374e4fe --- /dev/null +++ b/official/release-3.4.20/json/gamepad.json @@ -0,0 +1,1172 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_STEAM" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/gpu.json b/official/release-3.4.20/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.20/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/guid.json b/official/release-3.4.20/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.20/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/haptic.json b/official/release-3.4.20/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.20/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/hints.json b/official/release-3.4.20/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.20/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/init.json b/official/release-3.4.20/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.20/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/iostream.json b/official/release-3.4.20/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.20/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/joystick.json b/official/release-3.4.20/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.20/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/keyboard.json b/official/release-3.4.20/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.20/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/keycode.json b/official/release-3.4.20/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.20/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/loadso.json b/official/release-3.4.20/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.20/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/messagebox.json b/official/release-3.4.20/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.20/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/misc.json b/official/release-3.4.20/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.20/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/mouse.json b/official/release-3.4.20/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.20/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/opengl.json b/official/release-3.4.20/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.20/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/pen.json b/official/release-3.4.20/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.20/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/pixels.json b/official/release-3.4.20/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.20/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/power.json b/official/release-3.4.20/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.20/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/process.json b/official/release-3.4.20/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.20/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/properties.json b/official/release-3.4.20/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.20/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/rect.json b/official/release-3.4.20/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.20/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/render.json b/official/release-3.4.20/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.20/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/scancode.json b/official/release-3.4.20/json/scancode.json new file mode 100644 index 0000000..e457ddd --- /dev/null +++ b/official/release-3.4.20/json/scancode.json @@ -0,0 +1,1088 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_FRONT", + "value": "165", + "comment": "Front (Sun keyboards)" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/sensor.json b/official/release-3.4.20/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.20/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/storage.json b/official/release-3.4.20/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.20/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/surface.json b/official/release-3.4.20/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.20/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/system.json b/official/release-3.4.20/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.20/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/time.json b/official/release-3.4.20/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.20/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/timer.json b/official/release-3.4.20/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.20/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/touch.json b/official/release-3.4.20/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.20/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/tray.json b/official/release-3.4.20/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.20/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/version.json b/official/release-3.4.20/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.20/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.20/json/video.json b/official/release-3.4.20/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.20/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/api/audio.zig b/official/release-3.4.4/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.4/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.4/api/blendmode.zig b/official/release-3.4.4/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.4/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.4/api/c.zig b/official/release-3.4.4/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.4/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.4/api/camera.zig b/official/release-3.4.4/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.4/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.4/api/clipboard.zig b/official/release-3.4.4/api/clipboard.zig new file mode 100644 index 0000000..6fe8270 --- /dev/null +++ b/official/release-3.4.4/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.4/api/dialog.zig b/official/release-3.4.4/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.4/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.4/api/endian.zig b/official/release-3.4.4/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.4/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.4/api/error.zig b/official/release-3.4.4/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.4/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.4/api/events.zig b/official/release-3.4.4/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/official/release-3.4.4/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.4/api/filesystem.zig b/official/release-3.4.4/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.4/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.4/api/gamepad.zig b/official/release-3.4.4/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/official/release-3.4.4/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.4/api/gpu.zig b/official/release-3.4.4/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.4/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.4/api/guid.zig b/official/release-3.4.4/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.4/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.4/api/haptic.zig b/official/release-3.4.4/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.4/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.4/api/hints.zig b/official/release-3.4.4/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.4/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.4/api/init.zig b/official/release-3.4.4/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.4/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.4/api/iostream.zig b/official/release-3.4.4/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.4/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.4/api/joystick.zig b/official/release-3.4.4/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.4/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.4/api/keyboard.zig b/official/release-3.4.4/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.4/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.4/api/keycode.zig b/official/release-3.4.4/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.4/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.4/api/loadso.zig b/official/release-3.4.4/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.4/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.4/api/messagebox.zig b/official/release-3.4.4/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.4/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.4/api/misc.zig b/official/release-3.4.4/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.4/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.4/api/mouse.zig b/official/release-3.4.4/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.4/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.4/api/opengl.zig b/official/release-3.4.4/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.4/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.4/api/pen.zig b/official/release-3.4.4/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.4/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.4/api/pixels.zig b/official/release-3.4.4/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.4/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.4/api/power.zig b/official/release-3.4.4/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.4/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.4/api/process.zig b/official/release-3.4.4/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.4/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.4/api/properties.zig b/official/release-3.4.4/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.4/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.4/api/rect.zig b/official/release-3.4.4/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.4/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.4/api/render.zig b/official/release-3.4.4/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.4/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.4/api/scancode.zig b/official/release-3.4.4/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.4/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.4/api/sensor.zig b/official/release-3.4.4/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.4/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.4/api/stdinc.zig b/official/release-3.4.4/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.4/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.4/api/storage.zig b/official/release-3.4.4/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.4/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.4/api/surface.zig b/official/release-3.4.4/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.4/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.4/api/system.zig b/official/release-3.4.4/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.4/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.4/api/time.zig b/official/release-3.4.4/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.4/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.4/api/timer.zig b/official/release-3.4.4/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.4/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.4/api/touch.zig b/official/release-3.4.4/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.4/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.4/api/tray.zig b/official/release-3.4.4/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.4/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.4/api/version.zig b/official/release-3.4.4/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.4/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.4/api/video.zig b/official/release-3.4.4/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.4/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.4/json/audio.json b/official/release-3.4.4/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.4/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/blendmode.json b/official/release-3.4.4/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.4/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/camera.json b/official/release-3.4.4/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.4/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/clipboard.json b/official/release-3.4.4/json/clipboard.json new file mode 100644 index 0000000..53889c5 --- /dev/null +++ b/official/release-3.4.4/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char **" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/dialog.json b/official/release-3.4.4/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.4/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/endian.json b/official/release-3.4.4/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.4/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/error.json b/official/release-3.4.4/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.4/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/events.json b/official/release-3.4.4/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/official/release-3.4.4/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/filesystem.json b/official/release-3.4.4/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.4/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/gamepad.json b/official/release-3.4.4/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/official/release-3.4.4/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/gpu.json b/official/release-3.4.4/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.4/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/guid.json b/official/release-3.4.4/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.4/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/haptic.json b/official/release-3.4.4/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.4/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/hints.json b/official/release-3.4.4/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.4/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/init.json b/official/release-3.4.4/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.4/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/iostream.json b/official/release-3.4.4/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.4/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/joystick.json b/official/release-3.4.4/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.4/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/keyboard.json b/official/release-3.4.4/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.4/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/keycode.json b/official/release-3.4.4/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.4/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/loadso.json b/official/release-3.4.4/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.4/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/messagebox.json b/official/release-3.4.4/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.4/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/misc.json b/official/release-3.4.4/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.4/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/mouse.json b/official/release-3.4.4/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.4/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/opengl.json b/official/release-3.4.4/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.4/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/pen.json b/official/release-3.4.4/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.4/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/pixels.json b/official/release-3.4.4/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.4/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/power.json b/official/release-3.4.4/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.4/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/process.json b/official/release-3.4.4/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.4/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/properties.json b/official/release-3.4.4/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.4/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/rect.json b/official/release-3.4.4/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.4/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/render.json b/official/release-3.4.4/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.4/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/scancode.json b/official/release-3.4.4/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.4/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/sensor.json b/official/release-3.4.4/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.4/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/storage.json b/official/release-3.4.4/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.4/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/surface.json b/official/release-3.4.4/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.4/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/system.json b/official/release-3.4.4/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.4/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/time.json b/official/release-3.4.4/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.4/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/timer.json b/official/release-3.4.4/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.4/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/touch.json b/official/release-3.4.4/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.4/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/tray.json b/official/release-3.4.4/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.4/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/version.json b/official/release-3.4.4/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.4/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.4/json/video.json b/official/release-3.4.4/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.4/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/api/audio.zig b/official/release-3.4.6/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.6/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.6/api/blendmode.zig b/official/release-3.4.6/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.6/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.6/api/c.zig b/official/release-3.4.6/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.6/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.6/api/camera.zig b/official/release-3.4.6/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.6/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.6/api/clipboard.zig b/official/release-3.4.6/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.6/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.6/api/dialog.zig b/official/release-3.4.6/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.6/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.6/api/endian.zig b/official/release-3.4.6/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.6/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.6/api/error.zig b/official/release-3.4.6/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.6/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.6/api/events.zig b/official/release-3.4.6/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/official/release-3.4.6/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.6/api/filesystem.zig b/official/release-3.4.6/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.6/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.6/api/gamepad.zig b/official/release-3.4.6/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/official/release-3.4.6/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.6/api/gpu.zig b/official/release-3.4.6/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.6/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.6/api/guid.zig b/official/release-3.4.6/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.6/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.6/api/haptic.zig b/official/release-3.4.6/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.6/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.6/api/hints.zig b/official/release-3.4.6/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.6/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.6/api/init.zig b/official/release-3.4.6/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.6/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.6/api/iostream.zig b/official/release-3.4.6/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.6/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.6/api/joystick.zig b/official/release-3.4.6/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.6/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.6/api/keyboard.zig b/official/release-3.4.6/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.6/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.6/api/keycode.zig b/official/release-3.4.6/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.6/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.6/api/loadso.zig b/official/release-3.4.6/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.6/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.6/api/messagebox.zig b/official/release-3.4.6/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.6/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.6/api/misc.zig b/official/release-3.4.6/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.6/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.6/api/mouse.zig b/official/release-3.4.6/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.6/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.6/api/opengl.zig b/official/release-3.4.6/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.6/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.6/api/pen.zig b/official/release-3.4.6/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.6/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.6/api/pixels.zig b/official/release-3.4.6/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.6/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.6/api/power.zig b/official/release-3.4.6/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.6/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.6/api/process.zig b/official/release-3.4.6/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.6/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.6/api/properties.zig b/official/release-3.4.6/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.6/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.6/api/rect.zig b/official/release-3.4.6/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.6/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.6/api/render.zig b/official/release-3.4.6/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.6/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.6/api/scancode.zig b/official/release-3.4.6/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.6/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.6/api/sensor.zig b/official/release-3.4.6/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.6/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.6/api/stdinc.zig b/official/release-3.4.6/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.6/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.6/api/storage.zig b/official/release-3.4.6/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.6/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.6/api/surface.zig b/official/release-3.4.6/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.6/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.6/api/system.zig b/official/release-3.4.6/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.6/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.6/api/time.zig b/official/release-3.4.6/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.6/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.6/api/timer.zig b/official/release-3.4.6/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.6/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.6/api/touch.zig b/official/release-3.4.6/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.6/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.6/api/tray.zig b/official/release-3.4.6/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.6/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.6/api/version.zig b/official/release-3.4.6/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.6/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.6/api/video.zig b/official/release-3.4.6/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.6/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.6/json/audio.json b/official/release-3.4.6/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.6/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/blendmode.json b/official/release-3.4.6/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.6/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/camera.json b/official/release-3.4.6/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.6/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/clipboard.json b/official/release-3.4.6/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.6/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/dialog.json b/official/release-3.4.6/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.6/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/endian.json b/official/release-3.4.6/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.6/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/error.json b/official/release-3.4.6/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.6/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/events.json b/official/release-3.4.6/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/official/release-3.4.6/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/filesystem.json b/official/release-3.4.6/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.6/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/gamepad.json b/official/release-3.4.6/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/official/release-3.4.6/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/gpu.json b/official/release-3.4.6/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.6/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/guid.json b/official/release-3.4.6/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.6/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/haptic.json b/official/release-3.4.6/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.6/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/hints.json b/official/release-3.4.6/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.6/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/init.json b/official/release-3.4.6/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.6/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/iostream.json b/official/release-3.4.6/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.6/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/joystick.json b/official/release-3.4.6/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.6/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/keyboard.json b/official/release-3.4.6/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.6/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/keycode.json b/official/release-3.4.6/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.6/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/loadso.json b/official/release-3.4.6/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.6/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/messagebox.json b/official/release-3.4.6/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.6/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/misc.json b/official/release-3.4.6/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.6/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/mouse.json b/official/release-3.4.6/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.6/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/opengl.json b/official/release-3.4.6/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.6/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/pen.json b/official/release-3.4.6/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.6/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/pixels.json b/official/release-3.4.6/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.6/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/power.json b/official/release-3.4.6/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.6/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/process.json b/official/release-3.4.6/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.6/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/properties.json b/official/release-3.4.6/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.6/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/rect.json b/official/release-3.4.6/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.6/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/render.json b/official/release-3.4.6/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.6/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/scancode.json b/official/release-3.4.6/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.6/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/sensor.json b/official/release-3.4.6/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.6/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/storage.json b/official/release-3.4.6/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.6/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/surface.json b/official/release-3.4.6/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.6/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/system.json b/official/release-3.4.6/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.6/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/time.json b/official/release-3.4.6/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.6/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/timer.json b/official/release-3.4.6/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.6/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/touch.json b/official/release-3.4.6/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.6/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/tray.json b/official/release-3.4.6/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.6/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/version.json b/official/release-3.4.6/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.6/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.6/json/video.json b/official/release-3.4.6/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.6/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/api/audio.zig b/official/release-3.4.8/api/audio.zig new file mode 100644 index 0000000..e8689f8 --- /dev/null +++ b/official/release-3.4.8/api/audio.zig @@ -0,0 +1,271 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const iostream_api = @import("iostream.zig"); +const properties_api = @import("properties.zig"); + +pub const IOStream = iostream_api.IOStream; +pub const PropertiesID = properties_api.PropertiesID; + +pub const AudioFormat = enum(c_int) { + audioUnknown = 0x0000, //Unspecified audio format + audioU8 = 0x0008, //Unsigned 8-bit samples + audioS8 = 0x8008, //Signed 8-bit samples + audioS16le = 0x8010, //Signed 16-bit samples + audioS16be = 0x9010, //As above, but big-endian byte order + audioS32le = 0x8020, //32-bit integer samples + audioS32be = 0x9020, //As above, but big-endian byte order + audioF32le = 0x8120, //32-bit floating point samples + audioF32be = 0x9120, //As above, but big-endian byte order + + pub const audioS16 = .audioS16le; + pub const audioS32 = .audioS32le; + pub const audioF32 = .audioF32le; +}; + +pub const AudioDeviceID = u32; + +pub const AudioSpec = extern struct { + format: AudioFormat, // Audio data format + channels: c_int, // Number of channels: 1 mono, 2 stereo, etc + freq: c_int, // sample rate: sample frames per second +}; + +pub const AudioStream = opaque { + pub inline fn unbindAudioStream(audiostream: *AudioStream) void { + return c.SDL_UnbindAudioStream(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID { + return c.SDL_GetAudioStreamDevice(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID { + return c.SDL_GetAudioStreamProperties(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool { + return @bitCast(c.SDL_GetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) bool { + return @bitCast(c.SDL_SetAudioStreamFormat(@ptrCast(@alignCast(audiostream)), @ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec)))); + } + + pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool { + return @bitCast(c.SDL_SetAudioStreamFrequencyRatio(@ptrCast(@alignCast(audiostream)), ratio)); + } + + pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 { + return c.SDL_GetAudioStreamGain(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool { + return @bitCast(c.SDL_SetAudioStreamGain(@ptrCast(@alignCast(audiostream)), gain)); + } + + pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: ?*c_int) *c_int { + return c.SDL_GetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), count); + } + + pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamInputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool { + return @bitCast(c.SDL_SetAudioStreamOutputChannelMap(@ptrCast(@alignCast(audiostream)), chmap, count)); + } + + pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len)); + } + + pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(@alignCast(audiostream)), buf, len, callback, userdata)); + } + + pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { + return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(@alignCast(audiostream)), channel_buffers, num_channels, num_samples)); + } + + pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { + return c.SDL_GetAudioStreamData(@ptrCast(@alignCast(audiostream)), buf, len); + } + + pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamAvailable(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int { + return c.SDL_GetAudioStreamQueued(@ptrCast(@alignCast(audiostream))); + } + + pub inline fn flushAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_FlushAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn clearAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ClearAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_PauseAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_ResumeAudioStreamDevice(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn audioStreamDevicePaused(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_AudioStreamDevicePaused(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn lockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_LockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn unlockAudioStream(audiostream: *AudioStream) bool { + return @bitCast(c.SDL_UnlockAudioStream(@ptrCast(@alignCast(audiostream)))); + } + + pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamGetCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioStreamPutCallback(@ptrCast(@alignCast(audiostream)), callback, userdata)); + } + + pub inline fn destroyAudioStream(audiostream: *AudioStream) void { + return c.SDL_DestroyAudioStream(@ptrCast(@alignCast(audiostream))); + } +}; + +pub inline fn getNumAudioDrivers() c_int { + return c.SDL_GetNumAudioDrivers(); +} + +pub inline fn getAudioDriver(index: c_int) [*c]const u8 { + return c.SDL_GetAudioDriver(index); +} + +pub inline fn getCurrentAudioDriver() [*c]const u8 { + return c.SDL_GetCurrentAudioDriver(); +} + +pub inline fn getAudioPlaybackDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioPlaybackDevices(count); +} + +pub inline fn getAudioRecordingDevices(count: ?*c_int) ?*AudioDeviceID { + return c.SDL_GetAudioRecordingDevices(count); +} + +pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 { + return c.SDL_GetAudioDeviceName(devid); +} + +pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: ?*c_int) bool { + return @bitCast(c.SDL_GetAudioDeviceFormat(devid, @ptrCast(@alignCast(spec)), sample_frames)); +} + +pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: ?*c_int) *c_int { + return c.SDL_GetAudioDeviceChannelMap(devid, count); +} + +pub inline fn openAudioDevice(devid: AudioDeviceID, spec: ?*const AudioSpec) AudioDeviceID { + return c.SDL_OpenAudioDevice(devid, @ptrCast(@alignCast(spec))); +} + +pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePhysical(devid)); +} + +pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); +} + +pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(devid)); +} + +pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(devid)); +} + +pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(devid)); +} + +pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { + return c.SDL_GetAudioDeviceGain(devid); +} + +pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool { + return @bitCast(c.SDL_SetAudioDeviceGain(devid, gain)); +} + +pub inline fn closeAudioDevice(devid: AudioDeviceID) void { + return c.SDL_CloseAudioDevice(devid); +} + +pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]const ?*AudioStream, num_streams: c_int) bool { + return @bitCast(c.SDL_BindAudioStreams(devid, @ptrCast(@alignCast(streams)), num_streams)); +} + +pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool { + return @bitCast(c.SDL_BindAudioStream(devid, @ptrCast(@alignCast(stream)))); +} + +pub inline fn unbindAudioStreams(streams: [*c]const ?*AudioStream, num_streams: c_int) void { + return c.SDL_UnbindAudioStreams(@ptrCast(@alignCast(streams)), num_streams); +} + +pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const AudioSpec) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_CreateAudioStream(@ptrCast(@alignCast(src_spec)), @ptrCast(@alignCast(dst_spec))))); +} + +pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; + +pub const AudioStreamCallback = c.SDL_AudioStreamCallback; + +pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { + return @ptrCast(@alignCast(c.SDL_OpenAudioDeviceStream(devid, @ptrCast(@alignCast(spec)), callback, userdata))); +} + +pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback; + +pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetAudioPostmixCallback(devid, callback, userdata)); +} + +pub inline fn loadWAV_IO(src: ?*IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV_IO(@ptrCast(@alignCast(src)), @bitCast(closeio), @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: ?*u32) bool { + return @bitCast(c.SDL_LoadWAV(path, @ptrCast(@alignCast(spec)), audio_buf, audio_len)); +} + +pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool { + return @bitCast(c.SDL_MixAudio(dst, src, @intCast(@backingInt(format)), len, volume)); +} + +pub inline fn convertAudioSamples(src_spec: ?*const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: ?*const AudioSpec, dst_data: [*c][*c]u8, dst_len: ?*c_int) bool { + return @bitCast(c.SDL_ConvertAudioSamples(@ptrCast(@alignCast(src_spec)), src_data, src_len, @ptrCast(@alignCast(dst_spec)), dst_data, dst_len)); +} + +pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 { + return c.SDL_GetAudioFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int { + return c.SDL_GetSilenceValueForFormat(@intCast(@backingInt(format))); +} diff --git a/official/release-3.4.8/api/blendmode.zig b/official/release-3.4.8/api/blendmode.zig new file mode 100644 index 0000000..2a64eca --- /dev/null +++ b/official/release-3.4.8/api/blendmode.zig @@ -0,0 +1,28 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const BlendMode = u32; + +pub const BlendOperation = enum(c_int) { + blendoperationAdd = 0x1, //dst + src: supported by all renderers + blendoperationSubtract = 0x2, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationRevSubtract = 0x3, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMinimum = 0x4, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan + blendoperationMaximum = 0x5, //max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan +}; + +pub const BlendFactor = enum(c_int) { + blendfactorZero = 0x1, //0, 0, 0, 0 + blendfactorOne = 0x2, //1, 1, 1, 1 + blendfactorSrcColor = 0x3, //srcR, srcG, srcB, srcA + blendfactorOneMinusSrcColor = 0x4, //1-srcR, 1-srcG, 1-srcB, 1-srcA + blendfactorSrcAlpha = 0x5, //srcA, srcA, srcA, srcA + blendfactorOneMinusSrcAlpha = 0x6, //1-srcA, 1-srcA, 1-srcA, 1-srcA + blendfactorDstColor = 0x7, //dstR, dstG, dstB, dstA + blendfactorOneMinusDstColor = 0x8, //1-dstR, 1-dstG, 1-dstB, 1-dstA + blendfactorDstAlpha = 0x9, //dstA, dstA, dstA, dstA + blendfactorOneMinusDstAlpha = 0xA, //1-dstA, 1-dstA, 1-dstA, 1-dstA +}; + +pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode { + return c.SDL_ComposeCustomBlendMode(@intCast(@backingInt(srcColorFactor)), @intCast(@backingInt(dstColorFactor)), @intCast(@backingInt(colorOperation)), @intCast(@backingInt(srcAlphaFactor)), @intCast(@backingInt(dstAlphaFactor)), @intCast(@backingInt(alphaOperation))); +} diff --git a/official/release-3.4.8/api/c.zig b/official/release-3.4.8/api/c.zig new file mode 100644 index 0000000..4732a3e --- /dev/null +++ b/official/release-3.4.8/api/c.zig @@ -0,0 +1 @@ +pub const c = @import("../c.zig").c; diff --git a/official/release-3.4.8/api/camera.zig b/official/release-3.4.8/api/camera.zig new file mode 100644 index 0000000..d1b7dd4 --- /dev/null +++ b/official/release-3.4.8/api/camera.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Surface = surface_api.Surface; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const CameraID = u32; + +pub const Camera = opaque { + pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + return @fromBackingInt(@intCast(c.SDL_GetCameraPermissionState(@ptrCast(@alignCast(camera))))); + } + + pub inline fn getCameraID(camera: *Camera) CameraID { + return c.SDL_GetCameraID(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraProperties(camera: *Camera) PropertiesID { + return c.SDL_GetCameraProperties(@ptrCast(@alignCast(camera))); + } + + pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool { + return @bitCast(c.SDL_GetCameraFormat(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(spec)))); + } + + pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: ?*u64) ?*Surface { + return @ptrCast(@alignCast(c.SDL_AcquireCameraFrame(@ptrCast(@alignCast(camera)), timestampNS))); + } + + pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void { + return c.SDL_ReleaseCameraFrame(@ptrCast(@alignCast(camera)), @ptrCast(@alignCast(frame))); + } + + pub inline fn closeCamera(camera: *Camera) void { + return c.SDL_CloseCamera(@ptrCast(@alignCast(camera))); + } +}; + +pub const CameraSpec = extern struct { + format: PixelFormat, // Frame format + colorspace: Colorspace, // Frame colorspace + width: c_int, // Frame width + height: c_int, // Frame height + framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) + framerate_denominator: c_int, // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) +}; + +pub const CameraPosition = enum(c_int) { + cameraPositionUnknown, + cameraPositionFrontFacing, + cameraPositionBackFacing, +}; + +pub const CameraPermissionState = enum(c_int) { + cameraPermissionStateDenied = -1, + cameraPermissionStatePending, + cameraPermissionStateApproved, +}; + +pub inline fn getNumCameraDrivers() c_int { + return c.SDL_GetNumCameraDrivers(); +} + +pub inline fn getCameraDriver(index: c_int) [*c]const u8 { + return c.SDL_GetCameraDriver(index); +} + +pub inline fn getCurrentCameraDriver() [*c]const u8 { + return c.SDL_GetCurrentCameraDriver(); +} + +pub inline fn getCameras(count: ?*c_int) ?*CameraID { + return c.SDL_GetCameras(count); +} + +pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: ?*c_int) [*c]?*CameraSpec { + return @ptrCast(@alignCast(c.SDL_GetCameraSupportedFormats(instance_id, count))); +} + +pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { + return c.SDL_GetCameraName(instance_id); +} + +pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition { + return @fromBackingInt(@intCast(c.SDL_GetCameraPosition(instance_id))); +} + +pub inline fn openCamera(instance_id: CameraID, spec: ?*const CameraSpec) ?*Camera { + return @ptrCast(@alignCast(c.SDL_OpenCamera(instance_id, @ptrCast(@alignCast(spec))))); +} diff --git a/official/release-3.4.8/api/clipboard.zig b/official/release-3.4.8/api/clipboard.zig new file mode 100644 index 0000000..305373b --- /dev/null +++ b/official/release-3.4.8/api/clipboard.zig @@ -0,0 +1,49 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn setClipboardText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetClipboardText(text)); +} + +pub inline fn getClipboardText() [*c]u8 { + return c.SDL_GetClipboardText(); +} + +pub inline fn hasClipboardText() bool { + return @bitCast(c.SDL_HasClipboardText()); +} + +pub inline fn setPrimarySelectionText(text: [*c]const u8) bool { + return @bitCast(c.SDL_SetPrimarySelectionText(text)); +} + +pub inline fn getPrimarySelectionText() [*c]u8 { + return c.SDL_GetPrimarySelectionText(); +} + +pub inline fn hasPrimarySelectionText() bool { + return @bitCast(c.SDL_HasPrimarySelectionText()); +} + +pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback; + +pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback; + +pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c]const [*c]const u8, num_mime_types: usize) bool { + return @bitCast(c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types)); +} + +pub inline fn clearClipboardData() bool { + return @bitCast(c.SDL_ClearClipboardData()); +} + +pub inline fn getClipboardData(mime_type: [*c]const u8, size: ?*usize) ?*anyopaque { + return c.SDL_GetClipboardData(mime_type, size); +} + +pub inline fn hasClipboardData(mime_type: [*c]const u8) bool { + return @bitCast(c.SDL_HasClipboardData(mime_type)); +} + +pub inline fn getClipboardMimeTypes(num_mime_types: ?*usize) [*c][*c]u8 { + return c.SDL_GetClipboardMimeTypes(num_mime_types); +} diff --git a/official/release-3.4.8/api/dialog.zig b/official/release-3.4.8/api/dialog.zig new file mode 100644 index 0000000..5f94fcf --- /dev/null +++ b/official/release-3.4.8/api/dialog.zig @@ -0,0 +1,36 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const properties_api = @import("properties.zig"); + +pub const Window = video_api.Window; +pub const PropertiesID = properties_api.PropertiesID; + +pub const DialogFileFilter = extern struct { + name: [*c]const u8, + pattern: [*c]const u8, +}; + +pub const DialogFileCallback = c.SDL_DialogFileCallback; + +pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location, @bitCast(allow_many)); +} + +pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: ?*const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void { + return c.SDL_ShowSaveFileDialog(callback, userdata, @ptrCast(@alignCast(window)), @ptrCast(@alignCast(filters)), nfilters, default_location); +} + +pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void { + return c.SDL_ShowOpenFolderDialog(callback, userdata, @ptrCast(@alignCast(window)), default_location, @bitCast(allow_many)); +} + +pub const FileDialogType = enum(c_int) { + filedialogOpenfile, + filedialogSavefile, + filedialogOpenfolder, +}; + +pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void { + return c.SDL_ShowFileDialogWithProperties(@intCast(@backingInt(_type)), callback, userdata, props); +} diff --git a/official/release-3.4.8/api/endian.zig b/official/release-3.4.8/api/endian.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.8/api/endian.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.8/api/error.zig b/official/release-3.4.8/api/error.zig new file mode 100644 index 0000000..9752b22 --- /dev/null +++ b/official/release-3.4.8/api/error.zig @@ -0,0 +1,18 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const unsupported = struct { + pub const SDL_SetError = "varargs function is not representable in Zig"; + pub const SDL_SetErrorV = "varargs function is not representable in Zig"; +}; + +pub inline fn outOfMemory() bool { + return @bitCast(c.SDL_OutOfMemory()); +} + +pub inline fn getError() [*c]const u8 { + return c.SDL_GetError(); +} + +pub inline fn clearError() bool { + return @bitCast(c.SDL_ClearError()); +} diff --git a/official/release-3.4.8/api/events.zig b/official/release-3.4.8/api/events.zig new file mode 100644 index 0000000..6c62826 --- /dev/null +++ b/official/release-3.4.8/api/events.zig @@ -0,0 +1,687 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pen_api = @import("pen.zig"); +const video_api = @import("video.zig"); +const audio_api = @import("audio.zig"); +const camera_api = @import("camera.zig"); +const mouse_api = @import("mouse.zig"); +const scancode_api = @import("scancode.zig"); +const touch_api = @import("touch.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const keycode_api = @import("keycode.zig"); +const sensor_api = @import("sensor.zig"); +const joystick_api = @import("joystick.zig"); + +pub const PenID = pen_api.PenID; +pub const WindowID = video_api.WindowID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const Scancode = scancode_api.Scancode; +pub const TouchID = touch_api.TouchID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PenAxis = pen_api.PenAxis; +pub const MouseID = mouse_api.MouseID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PowerState = power_api.PowerState; +pub const Window = video_api.Window; +pub const FingerID = touch_api.FingerID; +pub const Keycode = keycode_api.Keycode; +pub const SensorID = sensor_api.SensorID; +pub const JoystickID = joystick_api.JoystickID; +pub const Keymod = keycode_api.Keymod; + +pub const EventType = enum(c_int) { + eventFirst = 0, //Unused (do not remove) + eventQuit = 0x100, //User-requested quit + eventTerminating, //The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy() + eventLowMemory, //The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() + eventWillEnterBackground, //The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause() + eventDidEnterBackground, //The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause() + eventWillEnterForeground, //The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume() + eventDidEnterForeground, //The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume() + eventLocaleChanged, //The user's locale preferences have changed. + eventSystemThemeChanged, //The system theme changed + eventDisplayOrientation = 0x151, //Display orientation has changed to data1 + eventDisplayAdded, //Display has been added to the system + eventDisplayRemoved, //Display has been removed from the system + eventDisplayMoved, //Display has changed position + eventDisplayDesktopModeChanged, //Display has changed desktop mode + eventDisplayCurrentModeChanged, //Display has changed current mode + eventDisplayContentScaleChanged, //Display has changed content scale + eventDisplayUsableBoundsChanged, //Display has changed usable bounds + eventWindowShown = 0x202, //Window has been shown + eventWindowHidden, //Window has been hidden + eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. + eventWindowMoved, //Window has been moved to data1, data2 + eventWindowResized, //Window has been resized to data1xdata2 + eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2 + eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed + eventWindowMinimized, //Window has been minimized + eventWindowMaximized, //Window has been maximized + eventWindowRestored, //Window has been restored to normal size and position + eventWindowMouseEnter, //Window has gained mouse focus + eventWindowMouseLeave, //Window has lost mouse focus + eventWindowFocusGained, //Window has gained keyboard focus + eventWindowFocusLost, //Window has lost keyboard focus + eventWindowCloseRequested, //The window manager requests that the window be closed + eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL + eventWindowIccprofChanged, //The ICC profile of the window's display has changed + eventWindowDisplayChanged, //Window has been moved to display data1 + eventWindowDisplayScaleChanged, //Window display scale has been changed + eventWindowSafeAreaChanged, //The window safe area has been changed + eventWindowOccluded, //The window has been occluded + eventWindowEnterFullscreen, //The window has entered fullscreen mode + eventWindowLeaveFullscreen, //The window has left fullscreen mode + eventWindowDestroyed, //The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid + eventWindowHdrStateChanged, //Window HDR properties have changed + eventKeyDown = 0x300, //Key pressed + eventKeyUp, //Key released + eventTextEditing, //Keyboard text editing (composition) + eventTextInput, //Keyboard text input + eventKeymapChanged, //Keymap changed due to a system event such as an input language or keyboard layout change. + eventKeyboardAdded, //A new keyboard has been inserted into the system + eventKeyboardRemoved, //A keyboard has been removed + eventTextEditingCandidates, //Keyboard text editing candidates + eventScreenKeyboardShown, //The on-screen keyboard has been shown + eventScreenKeyboardHidden, //The on-screen keyboard has been hidden + eventMouseMotion = 0x400, //Mouse moved + eventMouseButtonDown, //Mouse button pressed + eventMouseButtonUp, //Mouse button released + eventMouseWheel, //Mouse wheel motion + eventMouseAdded, //A new mouse has been inserted into the system + eventMouseRemoved, //A mouse has been removed + eventJoystickAxisMotion = 0x600, //Joystick axis motion + eventJoystickBallMotion, //Joystick trackball motion + eventJoystickHatMotion, //Joystick hat position change + eventJoystickButtonDown, //Joystick button pressed + eventJoystickButtonUp, //Joystick button released + eventJoystickAdded, //A new joystick has been inserted into the system + eventJoystickRemoved, //An opened joystick has been removed + eventJoystickBatteryUpdated, //Joystick battery level change + eventJoystickUpdateComplete, //Joystick update is complete + eventGamepadAxisMotion = 0x650, //Gamepad axis motion + eventGamepadButtonDown, //Gamepad button pressed + eventGamepadButtonUp, //Gamepad button released + eventGamepadAdded, //A new gamepad has been inserted into the system + eventGamepadRemoved, //A gamepad has been removed + eventGamepadRemapped, //The gamepad mapping was updated + eventGamepadTouchpadDown, //Gamepad touchpad was touched + eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved + eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted + eventGamepadSensorUpdate, //Gamepad sensor was updated + eventGamepadUpdateComplete, //Gamepad update is complete + eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed + eventFingerDown = 0x700, + eventFingerUp, + eventFingerMotion, + eventFingerCanceled, + eventPinchBegin = 0x710, //Pinch gesture started + eventPinchUpdate, //Pinch gesture updated + eventPinchEnd, //Pinch gesture ended + eventClipboardUpdate = 0x900, //The clipboard changed + eventDropFile = 0x1000, //The system requests a file open + eventDropText, //text/plain drag-and-drop event + eventDropBegin, //A new set of drops is beginning (NULL filename) + eventDropComplete, //Current set of drops is now complete (NULL filename) + eventDropPosition, //Position while moving over the window + eventAudioDeviceAdded = 0x1100, //A new audio device is available + eventAudioDeviceRemoved, //An audio device has been removed. + eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system. + eventSensorUpdate = 0x1200, //A sensor was updated + eventPenProximityIn = 0x1300, //Pressure-sensitive pen has become available + eventPenProximityOut, //Pressure-sensitive pen has become unavailable + eventPenDown, //Pressure-sensitive pen touched drawing surface + eventPenUp, //Pressure-sensitive pen stopped touching drawing surface + eventPenButtonDown, //Pressure-sensitive pen button pressed + eventPenButtonUp, //Pressure-sensitive pen button released + eventPenMotion, //Pressure-sensitive pen is moving on the tablet + eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed + eventCameraDeviceAdded = 0x1400, //A new camera device is available + eventCameraDeviceRemoved, //A camera device has been removed. + eventCameraDeviceApproved, //A camera device has been approved for use by the user. + eventCameraDeviceDenied, //A camera device has been denied for use by the user. + eventRenderTargetsReset = 0x2000, //The render targets have been reset and their contents need to be updated + eventRenderDeviceReset, //The device has been reset and all textures need to be recreated + eventRenderDeviceLost, //The device has been lost and can't be recovered. + eventPrivate0 = 0x4000, + eventPrivate1, + eventPrivate2, + eventPrivate3, + eventPollSentinel = 0x7F00, //Signals the end of an event poll cycle + eventUser = 0x8000, + eventLast = 0xFFFF, + eventEnumPadding = 0x7FFFFFFF, + + pub const eventDisplayFirst = .eventDisplayOrientation; + pub const eventDisplayLast = .eventDisplayUsableBoundsChanged; + pub const eventWindowFirst = .eventWindowShown; + pub const eventWindowLast = .eventWindowHdrStateChanged; +}; + +pub const CommonEvent = extern struct { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const DisplayEvent = extern struct { + _type: EventType, // SDL_EVENT_DISPLAY_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + displayID: DisplayID, // The associated display + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const WindowEvent = extern struct { + _type: EventType, // SDL_EVENT_WINDOW_* + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window + data1: i32, // event dependent data + data2: i32, // event dependent data +}; + +pub const KeyboardDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: KeyboardID, // The keyboard instance id +}; + +pub const KeyboardEvent = extern struct { + _type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual + scancode: Scancode, // SDL physical key code + key: Keycode, // SDL virtual key code + mod: Keymod, // current key modifiers + raw: u16, // The platform dependent scancode for this event + down: bool, // true if the key is pressed + repeat: bool, // true if this is a key repeat +}; + +pub const TextEditingEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The editing text + start: i32, // The start cursor of selected editing text, or -1 if not set + length: i32, // The length of selected editing text, or -1 if not set +}; + +pub const TextEditingCandidatesEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + candidates: [*c][*c]const u8, // The list of candidates, or NULL if there are no candidates available + num_candidates: i32, // The number of strings in `candidates` + selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected + horizontal: bool, // true if the list is horizontal, false if it's vertical + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const TextInputEvent = extern struct { + _type: EventType, // SDL_EVENT_TEXT_INPUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with keyboard focus, if any + text: [*c]const u8, // The input text, UTF-8 encoded +}; + +pub const MouseDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: MouseID, // The mouse instance id +}; + +pub const MouseMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + state: MouseButtonFlags, // The current button state + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + xrel: f32, // The relative motion in the X direction + yrel: f32, // The relative motion in the Y direction +}; + +pub const MouseButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0 + button: u8, // The mouse button index + down: bool, // true if the button is pressed + clicks: u8, // 1 for single-click, 2 for double-click, etc. + padding: u8, + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const MouseWheelEvent = extern struct { + _type: EventType, // SDL_EVENT_MOUSE_WHEEL + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: MouseID, // The mouse instance id in relative mode or 0 + x: f32, // The amount scrolled horizontally, positive to the right and negative to the left + y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user + direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + mouse_x: f32, // X coordinate, relative to window + mouse_y: f32, // Y coordinate, relative to window + integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) + integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) +}; + +pub const JoyAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The joystick axis index + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const JoyBallEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + ball: u8, // The joystick trackball index + padding1: u8, + padding2: u8, + padding3: u8, + xrel: i16, // The relative motion in the X direction + yrel: i16, // The relative motion in the Y direction +}; + +pub const JoyHatEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + hat: u8, // The joystick hat index + value: u8, + padding1: u8, + padding2: u8, +}; + +pub const JoyButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The joystick button index + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const JoyDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const JoyBatteryEvent = extern struct { + _type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + state: PowerState, // The joystick battery state + percent: c_int, // The joystick battery percent charge remaining +}; + +pub const GamepadAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + axis: u8, // The gamepad axis (SDL_GamepadAxis) + padding1: u8, + padding2: u8, + padding3: u8, + value: i16, // The axis value (range: -32768 to 32767) + padding4: u16, +}; + +pub const GamepadButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + button: u8, // The gamepad button (SDL_GamepadButton) + down: bool, // true if the button is pressed + padding1: u8, + padding2: u8, +}; + +pub const GamepadDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id +}; + +pub const GamepadTouchpadEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + touchpad: i32, // The index of the touchpad + finger: i32, // The index of the finger on the touchpad + x: f32, // Normalized in the range 0...1 with 0 being on the left + y: f32, // Normalized in the range 0...1 with 0 being at the top + pressure: f32, // Normalized in the range 0...1 +}; + +pub const GamepadSensorEvent = extern struct { + _type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: JoystickID, // The joystick instance id + sensor: i32, // The type of the sensor, one of the values of SDL_SensorType + data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const AudioDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing + recording: bool, // false if a playback device, true if a recording device. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const CameraDeviceEvent = extern struct { + _type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: CameraID, // SDL_CameraID for the device being added or removed or changing +}; + +pub const RenderEvent = extern struct { + _type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window containing the renderer in question. +}; + +pub const TouchFingerEvent = extern struct { + _type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + touchID: TouchID, // The touch device id + fingerID: FingerID, + x: f32, // Normalized in the range 0...1 + y: f32, // Normalized in the range 0...1 + dx: f32, // Normalized in the range -1...1 + dy: f32, // Normalized in the range -1...1 + pressure: f32, // Normalized in the range 0...1 + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PinchFingerEvent = extern struct { + _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". + windowID: WindowID, // The window underneath the finger, if any +}; + +pub const PenProximityEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id +}; + +pub const PenMotionEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_MOTION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window +}; + +pub const PenTouchEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + eraser: bool, // true if eraser end is used (not all pens support this). + down: bool, // true if the pen is touching or false if the pen is lifted off +}; + +pub const PenButtonEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with mouse focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + button: u8, // The pen button index (first button is 1). + down: bool, // true if the button is pressed +}; + +pub const PenAxisEvent = extern struct { + _type: EventType, // SDL_EVENT_PEN_AXIS + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window with pen focus, if any + which: PenID, // The pen instance id + pen_state: PenInputFlags, // Complete pen input state at time of event + x: f32, // X coordinate, relative to window + y: f32, // Y coordinate, relative to window + axis: PenAxis, // Axis that has changed + value: f32, // New value of axis +}; + +pub const DropEvent = extern struct { + _type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The window that was dropped on, if any + x: f32, // X coordinate, relative to window (not on begin) + y: f32, // Y coordinate, relative to window (not on begin) + source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available + data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events +}; + +pub const ClipboardEvent = extern struct { + _type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + owner: bool, // are we owning the clipboard (internal update) + num_mime_types: i32, // number of mime types + mime_types: [*c][*c]const u8, // current mime types +}; + +pub const SensorEvent = extern struct { + _type: EventType, // SDL_EVENT_SENSOR_UPDATE + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + which: SensorID, // The instance ID of the sensor + data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() + sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock +}; + +pub const QuitEvent = extern struct { + _type: EventType, // SDL_EVENT_QUIT + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() +}; + +pub const UserEvent = extern struct { + _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + reserved: u32, + timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() + windowID: WindowID, // The associated window if any + code: i32, // User defined event code + data1: ?*anyopaque, // User defined data pointer + data2: ?*anyopaque, // User defined data pointer +}; + +pub const Event = extern union { + _type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration + common: CommonEvent, // Common event data + display: DisplayEvent, // Display event data + window: WindowEvent, // Window event data + kdevice: KeyboardDeviceEvent, // Keyboard device change event data + key: KeyboardEvent, // Keyboard event data + edit: TextEditingEvent, // Text editing event data + edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data + text: TextInputEvent, // Text input event data + mdevice: MouseDeviceEvent, // Mouse device change event data + motion: MouseMotionEvent, // Mouse motion event data + button: MouseButtonEvent, // Mouse button event data + wheel: MouseWheelEvent, // Mouse wheel event data + jdevice: JoyDeviceEvent, // Joystick device change event data + jaxis: JoyAxisEvent, // Joystick axis event data + jball: JoyBallEvent, // Joystick ball event data + jhat: JoyHatEvent, // Joystick hat event data + jbutton: JoyButtonEvent, // Joystick button event data + jbattery: JoyBatteryEvent, // Joystick battery event data + gdevice: GamepadDeviceEvent, // Gamepad device event data + gaxis: GamepadAxisEvent, // Gamepad axis event data + gbutton: GamepadButtonEvent, // Gamepad button event data + gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data + gsensor: GamepadSensorEvent, // Gamepad sensor event data + adevice: AudioDeviceEvent, // Audio device event data + cdevice: CameraDeviceEvent, // Camera device event data + sensor: SensorEvent, // Sensor event data + quit: QuitEvent, // Quit request event data + user: UserEvent, // Custom event data + tfinger: TouchFingerEvent, // Touch finger event data + pinch: PinchFingerEvent, // Pinch event data + pproximity: PenProximityEvent, // Pen proximity event data + ptouch: PenTouchEvent, // Pen tip touching event data + pmotion: PenMotionEvent, // Pen motion event data + pbutton: PenButtonEvent, // Pen button event data + paxis: PenAxisEvent, // Pen axis event data + render: RenderEvent, // Render event data + drop: DropEvent, // Drag and drop event data + clipboard: ClipboardEvent, // Clipboard event data + padding: [128]u8, +}; + +pub inline fn pumpEvents() void { + return c.SDL_PumpEvents(); +} + +pub const EventAction = enum(c_int) { + addevent, //Add events to the back of the queue. + peekevent, //Check but don't remove events from the queue front. + getevent, //Retrieve/remove events from the front of the queue. +}; + +pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int { + return c.SDL_PeepEvents(@ptrCast(@alignCast(events)), numevents, @intCast(@backingInt(action)), minType, maxType); +} + +pub inline fn hasEvent(_type: u32) bool { + return @bitCast(c.SDL_HasEvent(_type)); +} + +pub inline fn hasEvents(minType: u32, maxType: u32) bool { + return @bitCast(c.SDL_HasEvents(minType, maxType)); +} + +pub inline fn flushEvent(_type: u32) void { + return c.SDL_FlushEvent(_type); +} + +pub inline fn flushEvents(minType: u32, maxType: u32) void { + return c.SDL_FlushEvents(minType, maxType); +} + +pub inline fn pollEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PollEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEvent(event: ?*Event) bool { + return @bitCast(c.SDL_WaitEvent(@ptrCast(@alignCast(event)))); +} + +pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool { + return @bitCast(c.SDL_WaitEventTimeout(@ptrCast(@alignCast(event)), timeoutMS)); +} + +pub inline fn pushEvent(event: ?*Event) bool { + return @bitCast(c.SDL_PushEvent(@ptrCast(@alignCast(event)))); +} + +pub const EventFilter = c.SDL_EventFilter; + +pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_SetEventFilter(filter, userdata); +} + +pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool { + return @bitCast(c.SDL_GetEventFilter(filter, userdata)); +} + +pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddEventWatch(filter, userdata)); +} + +pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_RemoveEventWatch(filter, userdata); +} + +pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void { + return c.SDL_FilterEvents(filter, userdata); +} + +pub inline fn setEventEnabled(_type: u32, enabled: bool) void { + return c.SDL_SetEventEnabled(_type, @bitCast(enabled)); +} + +pub inline fn eventEnabled(_type: u32) bool { + return @bitCast(c.SDL_EventEnabled(_type)); +} + +pub inline fn registerEvents(numevents: c_int) u32 { + return c.SDL_RegisterEvents(numevents); +} + +pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromEvent(@ptrCast(@alignCast(event))))); +} + +pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { + return c.SDL_GetEventDescription(@ptrCast(@alignCast(event)), buf, buflen); +} diff --git a/official/release-3.4.8/api/filesystem.zig b/official/release-3.4.8/api/filesystem.zig new file mode 100644 index 0000000..48f8e71 --- /dev/null +++ b/official/release-3.4.8/api/filesystem.zig @@ -0,0 +1,95 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub inline fn getBasePath() [*c]const u8 { + return c.SDL_GetBasePath(); +} + +pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 { + return c.SDL_GetPrefPath(org, app); +} + +pub const Folder = enum(c_int) { + folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. + folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. + folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects. + folderDownloads, //Standard folder for user files downloaded from the internet. + folderMusic, //Music files that can be played using a standard music player (mp3, ogg...). + folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...). + folderPublicshare, //Files that are meant to be shared with other users on the same computer. + folderSavedgames, //Save files for games. + folderScreenshots, //Application screenshots. + folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. + folderVideos, //Video files that can be played using a standard video player (mp4, webm...). + folderCount, //Total number of types in this enum, not a folder type by itself. +}; + +pub inline fn getUserFolder(folder: Folder) [*c]const u8 { + return c.SDL_GetUserFolder(@intCast(@backingInt(folder))); +} + +pub const PathType = enum(c_int) { + pathtypeNone, //path does not exist + pathtypeFile, //a normal file + pathtypeDirectory, //a directory + pathtypeOther, //something completely different like a device node (not a symlink, those are always followed) +}; + +pub const PathInfo = extern struct { + _type: PathType, // the path type + size: u64, // the file size in bytes + create_time: Time, // the time when the path was created + modify_time: Time, // the last time the path was modified + access_time: Time, // the last time the path was read +}; + +pub const GlobFlags = packed struct(u32) { + globCaseinsensitive: bool = false, + pad0: u30 = 0, + rsvd: bool = false, + + pub const None = GlobFlags{}; +}; + +pub inline fn createDirectory(path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateDirectory(path)); +} + +pub const EnumerationResult = enum(c_int) { + enumContinue, //Value that requests that enumeration continue. + enumSuccess, //Value that requests that enumeration stop, successfully. + enumFailure, //Value that requests that enumeration stop, as a failure. +}; + +pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback; + +pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateDirectory(path, callback, userdata)); +} + +pub inline fn removePath(path: [*c]const u8) bool { + return @bitCast(c.SDL_RemovePath(path)); +} + +pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenamePath(oldpath, newpath)); +} + +pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyFile(oldpath, newpath)); +} + +pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetPathInfo(path, @ptrCast(@alignCast(info)))); +} + +pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), count); +} + +pub inline fn getCurrentDirectory() [*c]u8 { + return c.SDL_GetCurrentDirectory(); +} diff --git a/official/release-3.4.8/api/gamepad.zig b/official/release-3.4.8/api/gamepad.zig new file mode 100644 index 0000000..f3ebe5c --- /dev/null +++ b/official/release-3.4.8/api/gamepad.zig @@ -0,0 +1,390 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); +const guid_api = @import("guid.zig"); +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); +const sensor_api = @import("sensor.zig"); +const power_api = @import("power.zig"); + +pub const JoystickConnectionState = joystick_api.JoystickConnectionState; +pub const GUID = guid_api.GUID; +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; +pub const JoystickID = joystick_api.JoystickID; +pub const SensorType = sensor_api.SensorType; +pub const PowerState = power_api.PowerState; +pub const Joystick = joystick_api.Joystick; + +pub const Gamepad = opaque { + pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 { + return c.SDL_GetGamepadMapping(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID { + return c.SDL_GetGamepadProperties(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID { + return c.SDL_GetGamepadID(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadName(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadPath(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadType(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int { + return c.SDL_GetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool { + return @bitCast(c.SDL_SetGamepadPlayerIndex(@ptrCast(@alignCast(gamepad)), player_index)); + } + + pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadVendor(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProduct(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadProductVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 { + return c.SDL_GetGamepadFirmwareVersion(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 { + return c.SDL_GetGamepadSerial(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 { + return c.SDL_GetGamepadSteamHandle(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadConnectionState(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetGamepadPowerInfo(@ptrCast(@alignCast(gamepad)), percent))); + } + + pub inline fn gamepadConnected(gamepad: *Gamepad) bool { + return @bitCast(c.SDL_GamepadConnected(@ptrCast(@alignCast(gamepad)))); + } + + pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetGamepadJoystick(@ptrCast(@alignCast(gamepad))))); + } + + pub inline fn getGamepadBindings(gamepad: *Gamepad, count: ?*c_int) [*c]?*GamepadBinding { + return @ptrCast(@alignCast(c.SDL_GetGamepadBindings(@ptrCast(@alignCast(gamepad)), count))); + } + + pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool { + return @bitCast(c.SDL_GamepadHasAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis)))); + } + + pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 { + return c.SDL_GetGamepadAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } + + pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GamepadHasButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool { + return @bitCast(c.SDL_GetGamepadButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button)))); + } + + pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabel(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))))); + } + + pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int { + return c.SDL_GetNumGamepadTouchpads(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int { + return c.SDL_GetNumGamepadTouchpadFingers(@ptrCast(@alignCast(gamepad)), touchpad); + } + + pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: ?*bool, x: ?*f32, y: ?*f32, pressure: ?*f32) bool { + return @bitCast(c.SDL_GetGamepadTouchpadFinger(@ptrCast(@alignCast(gamepad)), touchpad, finger, @ptrCast(@alignCast(down)), x, y, pressure)); + } + + pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadHasSensor(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool { + return @bitCast(c.SDL_SetGamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), @bitCast(enabled))); + } + + pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool { + return @bitCast(c.SDL_GamepadSensorEnabled(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)))); + } + + pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 { + return c.SDL_GetGamepadSensorDataRate(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type))); + } + + pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetGamepadSensorData(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(_type)), data, num_values)); + } + + pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepad(@ptrCast(@alignCast(gamepad)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleGamepadTriggers(@ptrCast(@alignCast(gamepad)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetGamepadLED(@ptrCast(@alignCast(gamepad)), red, green, blue)); + } + + pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendGamepadEffect(@ptrCast(@alignCast(gamepad)), data, size)); + } + + pub inline fn closeGamepad(gamepad: *Gamepad) void { + return c.SDL_CloseGamepad(@ptrCast(@alignCast(gamepad))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForButton(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(button))); + } + + pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(@ptrCast(@alignCast(gamepad)), @intCast(@backingInt(axis))); + } +}; + +pub const GamepadType = enum(c_int) { + gamepadTypeUnknown = 0, + gamepadTypeStandard, + gamepadTypeXbox360, + gamepadTypeXboxone, + gamepadTypePs3, + gamepadTypePs4, + gamepadTypePs5, + gamepadTypeNintendoSwitchPro, + gamepadTypeNintendoSwitchJoyconLeft, + gamepadTypeNintendoSwitchJoyconRight, + gamepadTypeNintendoSwitchJoyconPair, + gamepadTypeGamecube, + gamepadTypeCount, +}; + +pub const GamepadButton = enum(c_int) { + gamepadButtonInvalid = -1, + gamepadButtonSouth, //Bottom face button (e.g. Xbox A button) + gamepadButtonEast, //Right face button (e.g. Xbox B button) + gamepadButtonWest, //Left face button (e.g. Xbox X button) + gamepadButtonNorth, //Top face button (e.g. Xbox Y button) + gamepadButtonBack, + gamepadButtonGuide, + gamepadButtonStart, + gamepadButtonLeftStick, + gamepadButtonRightStick, + gamepadButtonLeftShoulder, + gamepadButtonRightShoulder, + gamepadButtonDpadUp, + gamepadButtonDpadDown, + gamepadButtonDpadLeft, + gamepadButtonDpadRight, + gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) + gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button) + gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) + gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) + gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button) + gamepadButtonTouchpad, //PS4/PS5 touchpad button + gamepadButtonMisc2, //Additional button + gamepadButtonMisc3, //Additional button (e.g. Nintendo GameCube left trigger click) + gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc5, //Additional button + gamepadButtonMisc6, //Additional button + gamepadButtonCount, +}; + +pub const GamepadButtonLabel = enum(c_int) { + gamepadButtonLabelUnknown, + gamepadButtonLabelA, + gamepadButtonLabelB, + gamepadButtonLabelX, + gamepadButtonLabelY, + gamepadButtonLabelCross, + gamepadButtonLabelCircle, + gamepadButtonLabelSquare, + gamepadButtonLabelTriangle, +}; + +pub const GamepadAxis = enum(c_int) { + gamepadAxisInvalid = -1, + gamepadAxisLeftx, + gamepadAxisLefty, + gamepadAxisRightx, + gamepadAxisRighty, + gamepadAxisLeftTrigger, + gamepadAxisRightTrigger, + gamepadAxisCount, +}; + +pub const GamepadBindingType = enum(c_int) { + gamepadBindtypeNone = 0, + gamepadBindtypeButton, + gamepadBindtypeAxis, + gamepadBindtypeHat, +}; + +pub const GamepadBinding = opaque {}; + +pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int { + return c.SDL_AddGamepadMapping(mapping); +} + +pub inline fn addGamepadMappingsFromIO(src: ?*IOStream, closeio: bool) c_int { + return c.SDL_AddGamepadMappingsFromIO(@ptrCast(@alignCast(src)), @bitCast(closeio)); +} + +pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int { + return c.SDL_AddGamepadMappingsFromFile(file); +} + +pub inline fn reloadGamepadMappings() bool { + return @bitCast(c.SDL_ReloadGamepadMappings()); +} + +pub inline fn getGamepadMappings(count: ?*c_int) [*c][*c]u8 { + return c.SDL_GetGamepadMappings(count); +} + +pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 { + return c.SDL_GetGamepadMappingForGUID(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*); +} + +pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool { + return @bitCast(c.SDL_SetGamepadMapping(instance_id, mapping)); +} + +pub inline fn hasGamepad() bool { + return @bitCast(c.SDL_HasGamepad()); +} + +pub inline fn getGamepads(count: ?*c_int) ?*JoystickID { + return c.SDL_GetGamepads(count); +} + +pub inline fn isGamepad(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsGamepad(instance_id)); +} + +pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadNameForID(instance_id); +} + +pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetGamepadPathForID(instance_id); +} + +pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetGamepadPlayerIndexForID(instance_id); +} + +pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetGamepadGUIDForID(instance_id)))).*; +} + +pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadVendorForID(instance_id); +} + +pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductForID(instance_id); +} + +pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetGamepadProductVersionForID(instance_id); +} + +pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeForID(instance_id))); +} + +pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetRealGamepadTypeForID(instance_id))); +} + +pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 { + return c.SDL_GetGamepadMappingForID(instance_id); +} + +pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_OpenGamepad(instance_id))); +} + +pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromID(instance_id))); +} + +pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad { + return @ptrCast(@alignCast(c.SDL_GetGamepadFromPlayerIndex(player_index))); +} + +pub inline fn setGamepadEventsEnabled(enabled: bool) void { + return c.SDL_SetGamepadEventsEnabled(@bitCast(enabled)); +} + +pub inline fn gamepadEventsEnabled() bool { + return @bitCast(c.SDL_GamepadEventsEnabled()); +} + +pub inline fn updateGamepads() void { + return c.SDL_UpdateGamepads(); +} + +pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType { + return @fromBackingInt(@intCast(c.SDL_GetGamepadTypeFromString(str))); +} + +pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 { + return c.SDL_GetGamepadStringForType(@intCast(@backingInt(_type))); +} + +pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis { + return @fromBackingInt(@intCast(c.SDL_GetGamepadAxisFromString(str))); +} + +pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 { + return c.SDL_GetGamepadStringForAxis(@intCast(@backingInt(axis))); +} + +pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonFromString(str))); +} + +pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 { + return c.SDL_GetGamepadStringForButton(@intCast(@backingInt(button))); +} + +pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel { + return @fromBackingInt(@intCast(c.SDL_GetGamepadButtonLabelForType(@intCast(@backingInt(_type)), @intCast(@backingInt(button))))); +} diff --git a/official/release-3.4.8/api/gpu.zig b/official/release-3.4.8/api/gpu.zig new file mode 100644 index 0000000..5dc12ac --- /dev/null +++ b/official/release-3.4.8/api/gpu.zig @@ -0,0 +1,1123 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const properties_api = @import("properties.zig"); +const rect_api = @import("rect.zig"); +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const FColor = pixels_api.FColor; +pub const PropertiesID = properties_api.PropertiesID; +pub const PixelFormat = pixels_api.PixelFormat; +pub const Rect = rect_api.Rect; +pub const Window = video_api.Window; +pub const FlipMode = surface_api.FlipMode; + +pub const GPUDevice = opaque { + pub inline fn destroyGPUDevice(gpudevice: *GPUDevice) void { + return c.SDL_DestroyGPUDevice(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUDeviceDriver(gpudevice: *GPUDevice) [*c]const u8 { + return c.SDL_GetGPUDeviceDriver(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn getGPUShaderFormats(gpudevice: *GPUDevice) GPUShaderFormat { + return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { + return c.SDL_GetGPUDeviceProperties(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUGraphicsPipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUGraphicsPipelineCreateInfo) ?*GPUGraphicsPipeline { + return @ptrCast(@alignCast(c.SDL_CreateGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUSampler(gpudevice: *GPUDevice, createinfo: ?*const GPUSamplerCreateInfo) ?*GPUSampler { + return @ptrCast(@alignCast(c.SDL_CreateGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUShader(gpudevice: *GPUDevice, createinfo: ?*const GPUShaderCreateInfo) ?*GPUShader { + return @ptrCast(@alignCast(c.SDL_CreateGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTexture(gpudevice: *GPUDevice, createinfo: ?*const GPUTextureCreateInfo) ?*GPUTexture { + return @ptrCast(@alignCast(c.SDL_CreateGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUBufferCreateInfo) ?*GPUBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn createGPUTransferBuffer(gpudevice: *GPUDevice, createinfo: ?*const GPUTransferBufferCreateInfo) ?*GPUTransferBuffer { + return @ptrCast(@alignCast(c.SDL_CreateGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPUBufferName(gpudevice: *GPUDevice, buffer: ?*GPUBuffer, text: [*c]const u8) void { + return c.SDL_SetGPUBufferName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer)), text); + } + + pub inline fn setGPUTextureName(gpudevice: *GPUDevice, texture: ?*GPUTexture, text: [*c]const u8) void { + return c.SDL_SetGPUTextureName(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture)), text); + } + + pub inline fn releaseGPUTexture(gpudevice: *GPUDevice, texture: ?*GPUTexture) void { + return c.SDL_ReleaseGPUTexture(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(texture))); + } + + pub inline fn releaseGPUSampler(gpudevice: *GPUDevice, sampler: ?*GPUSampler) void { + return c.SDL_ReleaseGPUSampler(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(sampler))); + } + + pub inline fn releaseGPUBuffer(gpudevice: *GPUDevice, buffer: ?*GPUBuffer) void { + return c.SDL_ReleaseGPUBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(buffer))); + } + + pub inline fn releaseGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_ReleaseGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn releaseGPUComputePipeline(gpudevice: *GPUDevice, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_ReleaseGPUComputePipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn releaseGPUShader(gpudevice: *GPUDevice, shader: ?*GPUShader) void { + return c.SDL_ReleaseGPUShader(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(shader))); + } + + pub inline fn releaseGPUGraphicsPipeline(gpudevice: *GPUDevice, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_ReleaseGPUGraphicsPipeline(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn acquireGPUCommandBuffer(gpudevice: *GPUDevice) ?*GPUCommandBuffer { + return @ptrCast(@alignCast(c.SDL_AcquireGPUCommandBuffer(@ptrCast(@alignCast(gpudevice))))); + } + + pub inline fn mapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer, cycle: bool) ?*anyopaque { + return c.SDL_MapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer)), @bitCast(cycle)); + } + + pub inline fn unmapGPUTransferBuffer(gpudevice: *GPUDevice, transfer_buffer: ?*GPUTransferBuffer) void { + return c.SDL_UnmapGPUTransferBuffer(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(transfer_buffer))); + } + + pub inline fn windowSupportsGPUSwapchainComposition(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition) bool { + return @bitCast(c.SDL_WindowSupportsGPUSwapchainComposition(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)))); + } + + pub inline fn windowSupportsGPUPresentMode(gpudevice: *GPUDevice, window: ?*Window, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_WindowSupportsGPUPresentMode(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn claimWindowForGPUDevice(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_ClaimWindowForGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn releaseWindowFromGPUDevice(gpudevice: *GPUDevice, window: ?*Window) void { + return c.SDL_ReleaseWindowFromGPUDevice(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))); + } + + pub inline fn setGPUSwapchainParameters(gpudevice: *GPUDevice, window: ?*Window, swapchain_composition: GPUSwapchainComposition, present_mode: GPUPresentMode) bool { + return @bitCast(c.SDL_SetGPUSwapchainParameters(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)), @intCast(@backingInt(swapchain_composition)), @intCast(@backingInt(present_mode)))); + } + + pub inline fn setGPUAllowedFramesInFlight(gpudevice: *GPUDevice, allowed_frames_in_flight: u32) bool { + return @bitCast(c.SDL_SetGPUAllowedFramesInFlight(@ptrCast(@alignCast(gpudevice)), allowed_frames_in_flight)); + } + + pub inline fn getGPUSwapchainTextureFormat(gpudevice: *GPUDevice, window: ?*Window) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUSwapchainTextureFormat(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window))))); + } + + pub inline fn waitForGPUSwapchain(gpudevice: *GPUDevice, window: ?*Window) bool { + return @bitCast(c.SDL_WaitForGPUSwapchain(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(window)))); + } + + pub inline fn waitForGPUIdle(gpudevice: *GPUDevice) bool { + return @bitCast(c.SDL_WaitForGPUIdle(@ptrCast(@alignCast(gpudevice)))); + } + + pub inline fn waitForGPUFences(gpudevice: *GPUDevice, wait_all: bool, fences: [*c]const ?*GPUFence, num_fences: u32) bool { + return @bitCast(c.SDL_WaitForGPUFences(@ptrCast(@alignCast(gpudevice)), @bitCast(wait_all), @ptrCast(@alignCast(fences)), num_fences)); + } + + pub inline fn queryGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) bool { + return @bitCast(c.SDL_QueryGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence)))); + } + + pub inline fn releaseGPUFence(gpudevice: *GPUDevice, fence: ?*GPUFence) void { + return c.SDL_ReleaseGPUFence(@ptrCast(@alignCast(gpudevice)), @ptrCast(@alignCast(fence))); + } + + pub inline fn gpuTextureSupportsFormat(gpudevice: *GPUDevice, format: GPUTextureFormat, _type: GPUTextureType, usage: GPUTextureUsageFlags) bool { + return @bitCast(c.SDL_GPUTextureSupportsFormat(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(_type)), @bitCast(usage))); + } + + pub inline fn gpuTextureSupportsSampleCount(gpudevice: *GPUDevice, format: GPUTextureFormat, sample_count: GPUSampleCount) bool { + return @bitCast(c.SDL_GPUTextureSupportsSampleCount(@ptrCast(@alignCast(gpudevice)), @intCast(@backingInt(format)), @intCast(@backingInt(sample_count)))); + } + + pub inline fn gdkSuspendGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKSuspendGPU(@ptrCast(@alignCast(gpudevice))); + } + + pub inline fn gdkResumeGPU(gpudevice: *GPUDevice) void { + return c.SDL_GDKResumeGPU(@ptrCast(@alignCast(gpudevice))); + } +}; + +pub const GPUBuffer = opaque {}; + +pub const GPUTransferBuffer = opaque {}; + +pub const GPUTexture = opaque {}; + +pub const GPUSampler = opaque {}; + +pub const GPUShader = opaque {}; + +pub const GPUComputePipeline = opaque {}; + +pub const GPUGraphicsPipeline = opaque {}; + +pub const GPUCommandBuffer = opaque { + pub inline fn insertGPUDebugLabel(gpucommandbuffer: *GPUCommandBuffer, text: [*c]const u8) void { + return c.SDL_InsertGPUDebugLabel(@ptrCast(@alignCast(gpucommandbuffer)), text); + } + + pub inline fn pushGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer, name: [*c]const u8) void { + return c.SDL_PushGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer)), name); + } + + pub inline fn popGPUDebugGroup(gpucommandbuffer: *GPUCommandBuffer) void { + return c.SDL_PopGPUDebugGroup(@ptrCast(@alignCast(gpucommandbuffer))); + } + + pub inline fn pushGPUVertexUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUVertexUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUFragmentUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUFragmentUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn pushGPUComputeUniformData(gpucommandbuffer: *GPUCommandBuffer, slot_index: u32, data: ?*const anyopaque, length: u32) void { + return c.SDL_PushGPUComputeUniformData(@ptrCast(@alignCast(gpucommandbuffer)), slot_index, data, length); + } + + pub inline fn beginGPURenderPass(gpucommandbuffer: *GPUCommandBuffer, color_target_infos: ?*const GPUColorTargetInfo, num_color_targets: u32, depth_stencil_target_info: ?*const GPUDepthStencilTargetInfo) ?*GPURenderPass { + return @ptrCast(@alignCast(c.SDL_BeginGPURenderPass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(color_target_infos)), num_color_targets, @ptrCast(@alignCast(depth_stencil_target_info))))); + } + + pub inline fn beginGPUComputePass(gpucommandbuffer: *GPUCommandBuffer, storage_texture_bindings: ?*const GPUStorageTextureReadWriteBinding, num_storage_texture_bindings: u32, storage_buffer_bindings: ?*const GPUStorageBufferReadWriteBinding, num_storage_buffer_bindings: u32) ?*GPUComputePass { + return @ptrCast(@alignCast(c.SDL_BeginGPUComputePass(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(storage_texture_bindings)), num_storage_texture_bindings, @ptrCast(@alignCast(storage_buffer_bindings)), num_storage_buffer_bindings))); + } + + pub inline fn beginGPUCopyPass(gpucommandbuffer: *GPUCommandBuffer) ?*GPUCopyPass { + return @ptrCast(@alignCast(c.SDL_BeginGPUCopyPass(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn generateMipmapsForGPUTexture(gpucommandbuffer: *GPUCommandBuffer, texture: ?*GPUTexture) void { + return c.SDL_GenerateMipmapsForGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(texture))); + } + + pub inline fn blitGPUTexture(gpucommandbuffer: *GPUCommandBuffer, info: ?*const GPUBlitInfo) void { + return c.SDL_BlitGPUTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(info))); + } + + pub inline fn acquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_AcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn waitAndAcquireGPUSwapchainTexture(gpucommandbuffer: *GPUCommandBuffer, window: ?*Window, swapchain_texture: [*c]?*GPUTexture, swapchain_texture_width: ?*u32, swapchain_texture_height: ?*u32) bool { + return @bitCast(c.SDL_WaitAndAcquireGPUSwapchainTexture(@ptrCast(@alignCast(gpucommandbuffer)), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(swapchain_texture)), swapchain_texture_width, swapchain_texture_height)); + } + + pub inline fn submitGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_SubmitGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } + + pub inline fn submitGPUCommandBufferAndAcquireFence(gpucommandbuffer: *GPUCommandBuffer) ?*GPUFence { + return @ptrCast(@alignCast(c.SDL_SubmitGPUCommandBufferAndAcquireFence(@ptrCast(@alignCast(gpucommandbuffer))))); + } + + pub inline fn cancelGPUCommandBuffer(gpucommandbuffer: *GPUCommandBuffer) bool { + return @bitCast(c.SDL_CancelGPUCommandBuffer(@ptrCast(@alignCast(gpucommandbuffer)))); + } +}; + +pub const GPURenderPass = opaque { + pub inline fn bindGPUGraphicsPipeline(gpurenderpass: *GPURenderPass, graphics_pipeline: ?*GPUGraphicsPipeline) void { + return c.SDL_BindGPUGraphicsPipeline(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(graphics_pipeline))); + } + + pub inline fn setGPUViewport(gpurenderpass: *GPURenderPass, viewport: ?*const GPUViewport) void { + return c.SDL_SetGPUViewport(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(viewport))); + } + + pub inline fn setGPUScissor(gpurenderpass: *GPURenderPass, scissor: ?*const Rect) void { + return c.SDL_SetGPUScissor(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(scissor))); + } + + pub inline fn setGPUBlendConstants(gpurenderpass: *GPURenderPass, blend_constants: FColor) void { + return c.SDL_SetGPUBlendConstants(@ptrCast(@alignCast(gpurenderpass)), @as(*const c.SDL_FColor, @ptrCast(@alignCast(&blend_constants))).*); + } + + pub inline fn setGPUStencilReference(gpurenderpass: *GPURenderPass, reference: u8) void { + return c.SDL_SetGPUStencilReference(@ptrCast(@alignCast(gpurenderpass)), reference); + } + + pub inline fn bindGPUVertexBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, bindings: ?*const GPUBufferBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(bindings)), num_bindings); + } + + pub inline fn bindGPUIndexBuffer(gpurenderpass: *GPURenderPass, binding: ?*const GPUBufferBinding, index_element_size: GPUIndexElementSize) void { + return c.SDL_BindGPUIndexBuffer(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(binding)), @intCast(@backingInt(index_element_size))); + } + + pub inline fn bindGPUVertexSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUVertexSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUVertexStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUVertexStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUVertexStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn bindGPUFragmentSamplers(gpurenderpass: *GPURenderPass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUFragmentSamplers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageTextures(gpurenderpass: *GPURenderPass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageTextures(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUFragmentStorageBuffers(gpurenderpass: *GPURenderPass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUFragmentStorageBuffers(@ptrCast(@alignCast(gpurenderpass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn drawGPUIndexedPrimitives(gpurenderpass: *GPURenderPass, num_indices: u32, num_instances: u32, first_index: u32, vertex_offset: i32, first_instance: u32) void { + return c.SDL_DrawGPUIndexedPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_indices, num_instances, first_index, vertex_offset, first_instance); + } + + pub inline fn drawGPUPrimitives(gpurenderpass: *GPURenderPass, num_vertices: u32, num_instances: u32, first_vertex: u32, first_instance: u32) void { + return c.SDL_DrawGPUPrimitives(@ptrCast(@alignCast(gpurenderpass)), num_vertices, num_instances, first_vertex, first_instance); + } + + pub inline fn drawGPUPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn drawGPUIndexedPrimitivesIndirect(gpurenderpass: *GPURenderPass, buffer: ?*GPUBuffer, offset: u32, draw_count: u32) void { + return c.SDL_DrawGPUIndexedPrimitivesIndirect(@ptrCast(@alignCast(gpurenderpass)), @ptrCast(@alignCast(buffer)), offset, draw_count); + } + + pub inline fn endGPURenderPass(gpurenderpass: *GPURenderPass) void { + return c.SDL_EndGPURenderPass(@ptrCast(@alignCast(gpurenderpass))); + } +}; + +pub const GPUComputePass = opaque { + pub inline fn bindGPUComputePipeline(gpucomputepass: *GPUComputePass, compute_pipeline: ?*GPUComputePipeline) void { + return c.SDL_BindGPUComputePipeline(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(compute_pipeline))); + } + + pub inline fn bindGPUComputeSamplers(gpucomputepass: *GPUComputePass, first_slot: u32, texture_sampler_bindings: ?*const GPUTextureSamplerBinding, num_bindings: u32) void { + return c.SDL_BindGPUComputeSamplers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(texture_sampler_bindings)), num_bindings); + } + + pub inline fn bindGPUComputeStorageTextures(gpucomputepass: *GPUComputePass, first_slot: u32, storage_textures: [*c]const ?*GPUTexture, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageTextures(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_textures)), num_bindings); + } + + pub inline fn bindGPUComputeStorageBuffers(gpucomputepass: *GPUComputePass, first_slot: u32, storage_buffers: [*c]const ?*GPUBuffer, num_bindings: u32) void { + return c.SDL_BindGPUComputeStorageBuffers(@ptrCast(@alignCast(gpucomputepass)), first_slot, @ptrCast(@alignCast(storage_buffers)), num_bindings); + } + + pub inline fn dispatchGPUCompute(gpucomputepass: *GPUComputePass, groupcount_x: u32, groupcount_y: u32, groupcount_z: u32) void { + return c.SDL_DispatchGPUCompute(@ptrCast(@alignCast(gpucomputepass)), groupcount_x, groupcount_y, groupcount_z); + } + + pub inline fn dispatchGPUComputeIndirect(gpucomputepass: *GPUComputePass, buffer: ?*GPUBuffer, offset: u32) void { + return c.SDL_DispatchGPUComputeIndirect(@ptrCast(@alignCast(gpucomputepass)), @ptrCast(@alignCast(buffer)), offset); + } + + pub inline fn endGPUComputePass(gpucomputepass: *GPUComputePass) void { + return c.SDL_EndGPUComputePass(@ptrCast(@alignCast(gpucomputepass))); + } +}; + +pub const GPUCopyPass = opaque { + pub inline fn uploadToGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureTransferInfo, destination: ?*const GPUTextureRegion, cycle: bool) void { + return c.SDL_UploadToGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn uploadToGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUTransferBufferLocation, destination: ?*const GPUBufferRegion, cycle: bool) void { + return c.SDL_UploadToGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), @bitCast(cycle)); + } + + pub inline fn copyGPUTextureToTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureLocation, destination: ?*const GPUTextureLocation, w: u32, h: u32, d: u32, cycle: bool) void { + return c.SDL_CopyGPUTextureToTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), w, h, d, @bitCast(cycle)); + } + + pub inline fn copyGPUBufferToBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferLocation, destination: ?*const GPUBufferLocation, size: u32, cycle: bool) void { + return c.SDL_CopyGPUBufferToBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination)), size, @bitCast(cycle)); + } + + pub inline fn downloadFromGPUTexture(gpucopypass: *GPUCopyPass, source: ?*const GPUTextureRegion, destination: ?*const GPUTextureTransferInfo) void { + return c.SDL_DownloadFromGPUTexture(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn downloadFromGPUBuffer(gpucopypass: *GPUCopyPass, source: ?*const GPUBufferRegion, destination: ?*const GPUTransferBufferLocation) void { + return c.SDL_DownloadFromGPUBuffer(@ptrCast(@alignCast(gpucopypass)), @ptrCast(@alignCast(source)), @ptrCast(@alignCast(destination))); + } + + pub inline fn endGPUCopyPass(gpucopypass: *GPUCopyPass) void { + return c.SDL_EndGPUCopyPass(@ptrCast(@alignCast(gpucopypass))); + } +}; + +pub const GPUFence = opaque {}; + +pub const GPUPrimitiveType = enum(c_int) { + primitivetypeTrianglelist, //A series of separate triangles. + primitivetypeTrianglestrip, //A series of connected triangles. + primitivetypeLinelist, //A series of separate lines. + primitivetypeLinestrip, //A series of connected lines. + primitivetypePointlist, //A series of separate points. +}; + +pub const GPULoadOp = enum(c_int) { + loadopLoad, //The previous contents of the texture will be preserved. + loadopClear, //The contents of the texture will be cleared to a color. + loadopDontCare, //The previous contents of the texture need not be preserved. The contents will be undefined. +}; + +pub const GPUStoreOp = enum(c_int) { + storeopStore, //The contents generated during the render pass will be written to memory. + storeopDontCare, //The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. + storeopResolve, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. + storeopResolveAndStore, //The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. +}; + +pub const GPUIndexElementSize = enum(c_int) { + indexelementsize16bit, //The index elements are 16-bit. + indexelementsize32bit, //The index elements are 32-bit. +}; + +pub const GPUTextureFormat = enum(c_int) { + textureformatInvalid, + textureformatA8Unorm, + textureformatR8Unorm, + textureformatR8g8Unorm, + textureformatR8g8b8a8Unorm, + textureformatR16Unorm, + textureformatR16g16Unorm, + textureformatR16g16b16a16Unorm, + textureformatR10g10b10a2Unorm, + textureformatB5g6r5Unorm, + textureformatB5g5r5a1Unorm, + textureformatB4g4r4a4Unorm, + textureformatB8g8r8a8Unorm, + textureformatBc1RgbaUnorm, + textureformatBc2RgbaUnorm, + textureformatBc3RgbaUnorm, + textureformatBc4RUnorm, + textureformatBc5RgUnorm, + textureformatBc7RgbaUnorm, + textureformatBc6hRgbFloat, + textureformatBc6hRgbUfloat, + textureformatR8Snorm, + textureformatR8g8Snorm, + textureformatR8g8b8a8Snorm, + textureformatR16Snorm, + textureformatR16g16Snorm, + textureformatR16g16b16a16Snorm, + textureformatR16Float, + textureformatR16g16Float, + textureformatR16g16b16a16Float, + textureformatR32Float, + textureformatR32g32Float, + textureformatR32g32b32a32Float, + textureformatR11g11b10Ufloat, + textureformatR8Uint, + textureformatR8g8Uint, + textureformatR8g8b8a8Uint, + textureformatR16Uint, + textureformatR16g16Uint, + textureformatR16g16b16a16Uint, + textureformatR32Uint, + textureformatR32g32Uint, + textureformatR32g32b32a32Uint, + textureformatR8Int, + textureformatR8g8Int, + textureformatR8g8b8a8Int, + textureformatR16Int, + textureformatR16g16Int, + textureformatR16g16b16a16Int, + textureformatR32Int, + textureformatR32g32Int, + textureformatR32g32b32a32Int, + textureformatR8g8b8a8UnormSrgb, + textureformatB8g8r8a8UnormSrgb, + textureformatBc1RgbaUnormSrgb, + textureformatBc2RgbaUnormSrgb, + textureformatBc3RgbaUnormSrgb, + textureformatBc7RgbaUnormSrgb, + textureformatD16Unorm, + textureformatD24Unorm, + textureformatD32Float, + textureformatD24UnormS8Uint, + textureformatD32FloatS8Uint, + textureformatAstc4x4Unorm, + textureformatAstc5x4Unorm, + textureformatAstc5x5Unorm, + textureformatAstc6x5Unorm, + textureformatAstc6x6Unorm, + textureformatAstc8x5Unorm, + textureformatAstc8x6Unorm, + textureformatAstc8x8Unorm, + textureformatAstc10x5Unorm, + textureformatAstc10x6Unorm, + textureformatAstc10x8Unorm, + textureformatAstc10x10Unorm, + textureformatAstc12x10Unorm, + textureformatAstc12x12Unorm, + textureformatAstc4x4UnormSrgb, + textureformatAstc5x4UnormSrgb, + textureformatAstc5x5UnormSrgb, + textureformatAstc6x5UnormSrgb, + textureformatAstc6x6UnormSrgb, + textureformatAstc8x5UnormSrgb, + textureformatAstc8x6UnormSrgb, + textureformatAstc8x8UnormSrgb, + textureformatAstc10x5UnormSrgb, + textureformatAstc10x6UnormSrgb, + textureformatAstc10x8UnormSrgb, + textureformatAstc10x10UnormSrgb, + textureformatAstc12x10UnormSrgb, + textureformatAstc12x12UnormSrgb, + textureformatAstc4x4Float, + textureformatAstc5x4Float, + textureformatAstc5x5Float, + textureformatAstc6x5Float, + textureformatAstc6x6Float, + textureformatAstc8x5Float, + textureformatAstc8x6Float, + textureformatAstc8x8Float, + textureformatAstc10x5Float, + textureformatAstc10x6Float, + textureformatAstc10x8Float, + textureformatAstc10x10Float, + textureformatAstc12x10Float, + textureformatAstc12x12Float, +}; + +pub const GPUTextureUsageFlags = packed struct(u32) { + textureusageSampler: bool = false, // Texture supports sampling. + textureusageColorTarget: bool = false, // Texture is a color render target. + textureusageDepthStencilTarget: bool = false, // Texture is a depth stencil target. + textureusageGraphicsStorageRead: bool = false, // Texture supports storage reads in graphics stages. + textureusageComputeStorageRead: bool = false, // Texture supports storage reads in the compute stage. + textureusageComputeStorageWrite: bool = false, // Texture supports storage writes in the compute stage. + textureusageComputeStorageSimultaneousReadWrite: bool = false, // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. + pad0: u24 = 0, + rsvd: bool = false, + + pub const None = GPUTextureUsageFlags{}; +}; + +pub const GPUTextureType = enum(c_int) { + texturetype2d, //The texture is a 2-dimensional image. + texturetype2dArray, //The texture is a 2-dimensional array image. + texturetype3d, //The texture is a 3-dimensional image. + texturetypeCube, //The texture is a cube image. + texturetypeCubeArray, //The texture is a cube array image. +}; + +pub const GPUSampleCount = enum(c_int) { + samplecount1, //No multisampling. + samplecount2, //MSAA 2x + samplecount4, //MSAA 4x + samplecount8, //MSAA 8x +}; + +pub const GPUCubeMapFace = enum(c_int) { + cubemapfacePositivex, + cubemapfaceNegativex, + cubemapfacePositivey, + cubemapfaceNegativey, + cubemapfacePositivez, + cubemapfaceNegativez, +}; + +pub const GPUBufferUsageFlags = packed struct(u32) { + bufferusageVertex: bool = false, // Buffer is a vertex buffer. + bufferusageIndex: bool = false, // Buffer is an index buffer. + bufferusageIndirect: bool = false, // Buffer is an indirect buffer. + bufferusageGraphicsStorageRead: bool = false, // Buffer supports storage reads in graphics stages. + bufferusageComputeStorageRead: bool = false, // Buffer supports storage reads in the compute stage. + bufferusageComputeStorageWrite: bool = false, // Buffer supports storage writes in the compute stage. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUBufferUsageFlags{}; +}; + +pub const GPUTransferBufferUsage = enum(c_int) { + transferbufferusageUpload, + transferbufferusageDownload, +}; + +pub const GPUShaderStage = enum(c_int) { + shaderstageVertex, + shaderstageFragment, +}; + +pub const GPUShaderFormat = packed struct(u32) { + shaderformatPrivate: bool = false, // Shaders for NDA'd platforms. + shaderformatSpirv: bool = false, // SPIR-V shaders for Vulkan. + shaderformatDxbc: bool = false, // DXBC SM5_1 shaders for D3D12. + shaderformatDxil: bool = false, // DXIL SM6_0 shaders for D3D12. + shaderformatMsl: bool = false, // MSL shaders for Metal. + shaderformatMetallib: bool = false, // Precompiled metallib shaders for Metal. + pad0: u25 = 0, + rsvd: bool = false, + + pub const None = GPUShaderFormat{}; +}; + +pub const GPUVertexElementFormat = enum(c_int) { + vertexelementformatInvalid, + vertexelementformatInt, + vertexelementformatInt2, + vertexelementformatInt3, + vertexelementformatInt4, + vertexelementformatUint, + vertexelementformatUint2, + vertexelementformatUint3, + vertexelementformatUint4, + vertexelementformatFloat, + vertexelementformatFloat2, + vertexelementformatFloat3, + vertexelementformatFloat4, + vertexelementformatByte2, + vertexelementformatByte4, + vertexelementformatUbyte2, + vertexelementformatUbyte4, + vertexelementformatByte2Norm, + vertexelementformatByte4Norm, + vertexelementformatUbyte2Norm, + vertexelementformatUbyte4Norm, + vertexelementformatShort2, + vertexelementformatShort4, + vertexelementformatUshort2, + vertexelementformatUshort4, + vertexelementformatShort2Norm, + vertexelementformatShort4Norm, + vertexelementformatUshort2Norm, + vertexelementformatUshort4Norm, + vertexelementformatHalf2, + vertexelementformatHalf4, +}; + +pub const GPUVertexInputRate = enum(c_int) { + vertexinputrateVertex, //Attribute addressing is a function of the vertex index. + vertexinputrateInstance, //Attribute addressing is a function of the instance index. +}; + +pub const GPUFillMode = enum(c_int) { + fillmodeFill, //Polygons will be rendered via rasterization. + fillmodeLine, //Polygon edges will be drawn as line segments. +}; + +pub const GPUCullMode = enum(c_int) { + cullmodeNone, //No triangles are culled. + cullmodeFront, //Front-facing triangles are culled. + cullmodeBack, //Back-facing triangles are culled. +}; + +pub const GPUFrontFace = enum(c_int) { + frontfaceCounterClockwise, //A triangle with counter-clockwise vertex winding will be considered front-facing. + frontfaceClockwise, //A triangle with clockwise vertex winding will be considered front-facing. +}; + +pub const GPUCompareOp = enum(c_int) { + compareopInvalid, + compareopNever, //The comparison always evaluates false. + compareopLess, //The comparison evaluates reference < test. + compareopEqual, //The comparison evaluates reference == test. + compareopLessOrEqual, //The comparison evaluates reference <= test. + compareopGreater, //The comparison evaluates reference > test. + compareopNotEqual, //The comparison evaluates reference != test. + compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopAlways, //The comparison always evaluates true. +}; + +pub const GPUStencilOp = enum(c_int) { + stencilopInvalid, + stencilopKeep, //Keeps the current value. + stencilopZero, //Sets the value to 0. + stencilopReplace, //Sets the value to reference. + stencilopIncrementAndClamp, //Increments the current value and clamps to the maximum value. + stencilopDecrementAndClamp, //Decrements the current value and clamps to 0. + stencilopInvert, //Bitwise-inverts the current value. + stencilopIncrementAndWrap, //Increments the current value and wraps back to 0. + stencilopDecrementAndWrap, //Decrements the current value and wraps to the maximum value. +}; + +pub const GPUBlendOp = enum(c_int) { + blendopInvalid, + blendopAdd, //(source * source_factor) + (destination * destination_factor) + blendopSubtract, //(source * source_factor) - (destination * destination_factor) + blendopReverseSubtract, //(destination * destination_factor) - (source * source_factor) + blendopMin, //min(source, destination) + blendopMax, //max(source, destination) +}; + +pub const GPUBlendFactor = enum(c_int) { + blendfactorInvalid, + blendfactorZero, //0 + blendfactorOne, //1 + blendfactorSrcColor, //source color + blendfactorOneMinusSrcColor, //1 - source color + blendfactorDstColor, //destination color + blendfactorOneMinusDstColor, //1 - destination color + blendfactorSrcAlpha, //source alpha + blendfactorOneMinusSrcAlpha, //1 - source alpha + blendfactorDstAlpha, //destination alpha + blendfactorOneMinusDstAlpha, //1 - destination alpha + blendfactorConstantColor, //blend constant + blendfactorOneMinusConstantColor, //1 - blend constant + blendfactorSrcAlphaSaturate, //min(source alpha, 1 - destination alpha) +}; + +pub const GPUColorComponentFlags = packed struct(u8) { + colorcomponentR: bool = false, // the red component + colorcomponentG: bool = false, // the green component + colorcomponentB: bool = false, // the blue component + colorcomponentA: bool = false, // the alpha component + pad0: u3 = 0, + rsvd: bool = false, + + pub const None = GPUColorComponentFlags{}; +}; + +pub const GPUFilter = enum(c_int) { + filterNearest, //Point filtering. + filterLinear, //Linear filtering. +}; + +pub const GPUSamplerMipmapMode = enum(c_int) { + samplermipmapmodeNearest, //Point filtering. + samplermipmapmodeLinear, //Linear filtering. +}; + +pub const GPUSamplerAddressMode = enum(c_int) { + sampleraddressmodeRepeat, //Specifies that the coordinates will wrap around. + sampleraddressmodeMirroredRepeat, //Specifies that the coordinates will wrap around mirrored. + sampleraddressmodeClampToEdge, //Specifies that the coordinates will clamp to the 0-1 range. +}; + +pub const GPUPresentMode = enum(c_int) { + presentmodeVsync, + presentmodeImmediate, + presentmodeMailbox, +}; + +pub const GPUSwapchainComposition = enum(c_int) { + swapchaincompositionSdr, + swapchaincompositionSdrLinear, + swapchaincompositionHdrExtendedLinear, + swapchaincompositionHdr10St2084, +}; + +pub const GPUViewport = extern struct { + x: f32, // The left offset of the viewport. + y: f32, // The top offset of the viewport. + w: f32, // The width of the viewport. + h: f32, // The height of the viewport. + min_depth: f32, // The minimum depth of the viewport. + max_depth: f32, // The maximum depth of the viewport. +}; + +pub const GPUTextureTransferInfo = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the image data in the transfer buffer. + pixels_per_row: u32, // The number of pixels from one row to the next. + rows_per_layer: u32, // The number of rows from one layer/depth-slice to the next. +}; + +pub const GPUTransferBufferLocation = extern struct { + transfer_buffer: ?*GPUTransferBuffer, // The transfer buffer used in the transfer operation. + offset: u32, // The starting byte of the buffer data in the transfer buffer. +}; + +pub const GPUTextureLocation = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index of the location. + layer: u32, // The layer index of the location. + x: u32, // The left offset of the location. + y: u32, // The top offset of the location. + z: u32, // The front offset of the location. +}; + +pub const GPUTextureRegion = extern struct { + texture: ?*GPUTexture, // The texture used in the copy operation. + mip_level: u32, // The mip level index to transfer. + layer: u32, // The layer index to transfer. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + z: u32, // The front offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. + d: u32, // The depth of the region. +}; + +pub const GPUBlitRegion = extern struct { + texture: ?*GPUTexture, // The texture. + mip_level: u32, // The mip level index of the region. + layer_or_depth_plane: u32, // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + x: u32, // The left offset of the region. + y: u32, // The top offset of the region. + w: u32, // The width of the region. + h: u32, // The height of the region. +}; + +pub const GPUBufferLocation = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. +}; + +pub const GPUBufferRegion = extern struct { + buffer: ?*GPUBuffer, // The buffer. + offset: u32, // The starting byte within the buffer. + size: u32, // The size in bytes of the region. +}; + +pub const GPUIndirectDrawCommand = extern struct { + num_vertices: u32, // The number of vertices to draw. + num_instances: u32, // The number of instances to draw. + first_vertex: u32, // The index of the first vertex to draw. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndexedIndirectDrawCommand = extern struct { + num_indices: u32, // The number of indices to draw per instance. + num_instances: u32, // The number of instances to draw. + first_index: u32, // The base index within the index buffer. + vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer. + first_instance: u32, // The ID of the first instance to draw. +}; + +pub const GPUIndirectDispatchCommand = extern struct { + groupcount_x: u32, // The number of local workgroups to dispatch in the X dimension. + groupcount_y: u32, // The number of local workgroups to dispatch in the Y dimension. + groupcount_z: u32, // The number of local workgroups to dispatch in the Z dimension. +}; + +pub const GPUSamplerCreateInfo = extern struct { + min_filter: GPUFilter, // The minification filter to apply to lookups. + mag_filter: GPUFilter, // The magnification filter to apply to lookups. + mipmap_mode: GPUSamplerMipmapMode, // The mipmap filter to apply to lookups. + address_mode_u: GPUSamplerAddressMode, // The addressing mode for U coordinates outside [0, 1). + address_mode_v: GPUSamplerAddressMode, // The addressing mode for V coordinates outside [0, 1). + address_mode_w: GPUSamplerAddressMode, // The addressing mode for W coordinates outside [0, 1). + mip_lod_bias: f32, // The bias to be added to mipmap LOD calculation. + max_anisotropy: f32, // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. + compare_op: GPUCompareOp, // The comparison operator to apply to fetched data before filtering. + min_lod: f32, // Clamps the minimum of the computed LOD value. + max_lod: f32, // Clamps the maximum of the computed LOD value. + enable_anisotropy: bool, // true to enable anisotropic filtering. + enable_compare: bool, // true to enable comparison against a reference value during lookups. + padding1: u8, + padding2: u8, + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUVertexBufferDescription = extern struct { + slot: u32, // The binding slot of the vertex buffer. + pitch: u32, // The size of a single element + the offset between elements. + input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. + instance_step_rate: u32, // Reserved for future use. Must be set to 0. +}; + +pub const GPUVertexAttribute = extern struct { + location: u32, // The shader input location index. + buffer_slot: u32, // The binding slot of the associated vertex buffer. + format: GPUVertexElementFormat, // The size and type of the attribute data. + offset: u32, // The byte offset of this attribute relative to the start of the vertex element. +}; + +pub const GPUVertexInputState = extern struct { + vertex_buffer_descriptions: [*c]const GPUVertexBufferDescription, // A pointer to an array of vertex buffer descriptions. + num_vertex_buffers: u32, // The number of vertex buffer descriptions in the above array. + vertex_attributes: [*c]const GPUVertexAttribute, // A pointer to an array of vertex attribute descriptions. + num_vertex_attributes: u32, // The number of vertex attribute descriptions in the above array. +}; + +pub const GPUStencilOpState = extern struct { + fail_op: GPUStencilOp, // The action performed on samples that fail the stencil test. + pass_op: GPUStencilOp, // The action performed on samples that pass the depth and stencil tests. + depth_fail_op: GPUStencilOp, // The action performed on samples that pass the stencil test and fail the depth test. + compare_op: GPUCompareOp, // The comparison operator used in the stencil test. +}; + +pub const GPUColorTargetBlendState = extern struct { + src_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the source RGB value. + dst_color_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination RGB value. + color_blend_op: GPUBlendOp, // The blend operation for the RGB components. + src_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the source alpha. + dst_alpha_blendfactor: GPUBlendFactor, // The value to be multiplied by the destination alpha. + alpha_blend_op: GPUBlendOp, // The blend operation for the alpha component. + color_write_mask: GPUColorComponentFlags, // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. + enable_blend: bool, // Whether blending is enabled for the color target. + enable_color_write_mask: bool, // Whether the color write mask is enabled. + padding1: u8, + padding2: u8, +}; + +pub const GPUShaderCreateInfo = extern struct { + code_size: usize, // The size in bytes of the code pointed to. + code: [*c]const u8, // A pointer to shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the shader code. + stage: GPUShaderStage, // The stage the shader program corresponds to. + num_samplers: u32, // The number of samplers defined in the shader. + num_storage_textures: u32, // The number of storage textures defined in the shader. + num_storage_buffers: u32, // The number of storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTextureCreateInfo = extern struct { + _type: GPUTextureType, // The base dimensionality of the texture. + format: GPUTextureFormat, // The pixel format of the texture. + usage: GPUTextureUsageFlags, // How the texture is intended to be used by the client. + width: u32, // The width of the texture. + height: u32, // The height of the texture. + layer_count_or_depth: u32, // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. + num_levels: u32, // The number of mip levels in the texture. + sample_count: GPUSampleCount, // The number of samples per texel. Only applies if the texture is used as a render target. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUBufferCreateInfo = extern struct { + usage: GPUBufferUsageFlags, // How the buffer is intended to be used by the client. + size: u32, // The size in bytes of the buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUTransferBufferCreateInfo = extern struct { + usage: GPUTransferBufferUsage, // How the transfer buffer is intended to be used by the client. + size: u32, // The size in bytes of the transfer buffer. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURasterizerState = extern struct { + fill_mode: GPUFillMode, // Whether polygons will be filled in or drawn as lines. + cull_mode: GPUCullMode, // The facing direction in which triangles will be culled. + front_face: GPUFrontFace, // The vertex winding that will cause a triangle to be determined as front-facing. + depth_bias_constant_factor: f32, // A scalar factor controlling the depth value added to each fragment. + depth_bias_clamp: f32, // The maximum depth bias of a fragment. + depth_bias_slope_factor: f32, // A scalar factor applied to a fragment's slope in depth calculations. + enable_depth_bias: bool, // true to bias fragment depth values. + enable_depth_clip: bool, // true to enable depth clip, false to enable depth clamp. + padding1: u8, + padding2: u8, +}; + +pub const GPUMultisampleState = extern struct { + sample_count: GPUSampleCount, // The number of samples to be used in rasterization. + sample_mask: u32, // Reserved for future use. Must be set to 0. + enable_mask: bool, // Reserved for future use. Must be set to false. + enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + padding2: u8, + padding3: u8, +}; + +pub const GPUDepthStencilState = extern struct { + compare_op: GPUCompareOp, // The comparison operator used for depth testing. + back_stencil_state: GPUStencilOpState, // The stencil op state for back-facing triangles. + front_stencil_state: GPUStencilOpState, // The stencil op state for front-facing triangles. + compare_mask: u8, // Selects the bits of the stencil values participating in the stencil test. + write_mask: u8, // Selects the bits of the stencil values updated by the stencil test. + enable_depth_test: bool, // true enables the depth test. + enable_depth_write: bool, // true enables depth writes. Depth writes are always disabled when enable_depth_test is false. + enable_stencil_test: bool, // true enables the stencil test. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUColorTargetDescription = extern struct { + format: GPUTextureFormat, // The pixel format of the texture to be used as a color target. + blend_state: GPUColorTargetBlendState, // The blend state to be used for the color target. +}; + +pub const GPUGraphicsPipelineTargetInfo = extern struct { + color_target_descriptions: [*c]const GPUColorTargetDescription, // A pointer to an array of color target descriptions. + num_color_targets: u32, // The number of color target descriptions in the above array. + depth_stencil_format: GPUTextureFormat, // The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. + has_depth_stencil_target: bool, // true specifies that the pipeline uses a depth-stencil target. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUGraphicsPipelineCreateInfo = extern struct { + vertex_shader: ?*GPUShader, // The vertex shader used by the graphics pipeline. + fragment_shader: ?*GPUShader, // The fragment shader used by the graphics pipeline. + vertex_input_state: GPUVertexInputState, // The vertex layout of the graphics pipeline. + primitive_type: GPUPrimitiveType, // The primitive topology of the graphics pipeline. + rasterizer_state: GPURasterizerState, // The rasterizer state of the graphics pipeline. + multisample_state: GPUMultisampleState, // The multisample state of the graphics pipeline. + depth_stencil_state: GPUDepthStencilState, // The depth-stencil state of the graphics pipeline. + target_info: GPUGraphicsPipelineTargetInfo, // Formats and blend modes for the render targets of the graphics pipeline. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUComputePipelineCreateInfo = extern struct { + code_size: usize, // The size in bytes of the compute shader code pointed to. + code: [*c]const u8, // A pointer to compute shader code. + entrypoint: [*c]const u8, // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. + format: GPUShaderFormat, // The format of the compute shader code. + num_samplers: u32, // The number of samplers defined in the shader. + num_readonly_storage_textures: u32, // The number of readonly storage textures defined in the shader. + num_readonly_storage_buffers: u32, // The number of readonly storage buffers defined in the shader. + num_readwrite_storage_textures: u32, // The number of read-write storage textures defined in the shader. + num_readwrite_storage_buffers: u32, // The number of read-write storage buffers defined in the shader. + num_uniform_buffers: u32, // The number of uniform buffers defined in the shader. + threadcount_x: u32, // The number of threads in the X dimension. This should match the value in the shader. + threadcount_y: u32, // The number of threads in the Y dimension. This should match the value in the shader. + threadcount_z: u32, // The number of threads in the Z dimension. This should match the value in the shader. + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPUColorTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as a color target by a render pass. + mip_level: u32, // The mip level to use as a color target. + layer_or_depth_plane: u32, // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. + clear_color: FColor, // The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the contents of the color target at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the results of the render pass. + resolve_texture: ?*GPUTexture, // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_mip_level: u32, // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + resolve_layer: u32, // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. + cycle: bool, // true cycles the texture if the texture is bound and load_op is not LOAD + cycle_resolve_texture: bool, // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. + padding1: u8, + padding2: u8, +}; + +pub const GPUDepthStencilTargetInfo = extern struct { + texture: ?*GPUTexture, // The texture that will be used as the depth stencil target by the render pass. + clear_depth: f32, // The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + load_op: GPULoadOp, // What is done with the depth contents at the beginning of the render pass. + store_op: GPUStoreOp, // What is done with the depth results of the render pass. + stencil_load_op: GPULoadOp, // What is done with the stencil contents at the beginning of the render pass. + stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. + cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD + clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. + mip_level: u8, // The mip level to use as the depth stencil target. + layer: u8, // The layer index to use as the depth stencil target. +}; + +pub const GPUBlitInfo = extern struct { + source: GPUBlitRegion, // The source region for the blit. + destination: GPUBlitRegion, // The destination region for the blit. + load_op: GPULoadOp, // What is done with the contents of the destination before the blit. + clear_color: FColor, // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. + flip_mode: FlipMode, // The flip mode for the source region. + filter: GPUFilter, // The filter mode used when blitting. + cycle: bool, // true cycles the destination texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUBufferBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. + offset: u32, // The starting byte of the data to bind in the buffer. +}; + +pub const GPUTextureSamplerBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. + sampler: ?*GPUSampler, // The sampler to bind. +}; + +pub const GPUStorageBufferReadWriteBinding = extern struct { + buffer: ?*GPUBuffer, // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. + cycle: bool, // true cycles the buffer if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub const GPUStorageTextureReadWriteBinding = extern struct { + texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. + mip_level: u32, // The mip level index to bind. + layer: u32, // The layer index to bind. + cycle: bool, // true cycles the texture if it is already bound. + padding1: u8, + padding2: u8, + padding3: u8, +}; + +pub inline fn gpuSupportsShaderFormats(format_flags: GPUShaderFormat, name: [*c]const u8) bool { + return @bitCast(c.SDL_GPUSupportsShaderFormats(@bitCast(format_flags), name)); +} + +pub inline fn gpuSupportsProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_GPUSupportsProperties(props)); +} + +pub inline fn createGPUDevice(format_flags: GPUShaderFormat, debug_mode: bool, name: [*c]const u8) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDevice(@bitCast(format_flags), @bitCast(debug_mode), name))); +} + +pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_CreateGPUDeviceWithProperties(props))); +} + +pub const GPUVulkanOptions = extern struct { + vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. + feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) + vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. + device_extension_count: u32, // Number of additional device extensions to require. + device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. + instance_extension_count: u32, // Number of additional instance extensions to require. + instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. +}; + +pub inline fn getNumGPUDrivers() c_int { + return c.SDL_GetNumGPUDrivers(); +} + +pub inline fn getGPUDriver(index: c_int) [*c]const u8 { + return c.SDL_GetGPUDriver(index); +} + +pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { + return c.SDL_GPUTextureFormatTexelBlockSize(@intCast(@backingInt(format))); +} + +pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { + return c.SDL_CalculateGPUTextureFormatSize(@intCast(@backingInt(format)), width, height, depth_or_layer_count); +} + +pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@intCast(@backingInt(format))))); +} + +pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { + return @fromBackingInt(@intCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@intCast(@backingInt(format))))); +} diff --git a/official/release-3.4.8/api/guid.zig b/official/release-3.4.8/api/guid.zig new file mode 100644 index 0000000..24aec09 --- /dev/null +++ b/official/release-3.4.8/api/guid.zig @@ -0,0 +1,13 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const GUID = extern struct { + data: [16]u8, +}; + +pub inline fn guidToString(guid: GUID, pszGUID: [*c]u8, cbGUID: c_int) void { + return c.SDL_GUIDToString(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, pszGUID, cbGUID); +} + +pub inline fn stringToGUID(pchGUID: [*c]const u8) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_StringToGUID(pchGUID)))).*; +} diff --git a/official/release-3.4.8/api/haptic.zig b/official/release-3.4.8/api/haptic.zig new file mode 100644 index 0000000..018f434 --- /dev/null +++ b/official/release-3.4.8/api/haptic.zig @@ -0,0 +1,239 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const joystick_api = @import("joystick.zig"); + +pub const Joystick = joystick_api.Joystick; + +pub const Haptic = opaque { + pub inline fn getHapticID(haptic: *Haptic) HapticID { + return c.SDL_GetHapticID(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 { + return c.SDL_GetHapticName(@ptrCast(@alignCast(haptic))); + } + + pub inline fn closeHaptic(haptic: *Haptic) void { + return c.SDL_CloseHaptic(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffects(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int { + return c.SDL_GetMaxHapticEffectsPlaying(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getHapticFeatures(haptic: *Haptic) u32 { + return c.SDL_GetHapticFeatures(@ptrCast(@alignCast(haptic))); + } + + pub inline fn getNumHapticAxes(haptic: *Haptic) c_int { + return c.SDL_GetNumHapticAxes(@ptrCast(@alignCast(haptic))); + } + + pub inline fn hapticEffectSupported(haptic: *Haptic, effect: ?*const HapticEffect) bool { + return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect)))); + } + + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + return c.SDL_CreateHapticEffect(@ptrCast(@alignCast(haptic)), @ptrCast(@alignCast(effect))); + } + + pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(@alignCast(haptic)), effect, @ptrCast(@alignCast(data)))); + } + + pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + return @bitCast(c.SDL_RunHapticEffect(@ptrCast(@alignCast(haptic)), effect, iterations)); + } + + pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_StopHapticEffect(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + return c.SDL_DestroyHapticEffect(@ptrCast(@alignCast(haptic)), effect); + } + + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(@alignCast(haptic)), effect)); + } + + pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool { + return @bitCast(c.SDL_SetHapticGain(@ptrCast(@alignCast(haptic)), gain)); + } + + pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool { + return @bitCast(c.SDL_SetHapticAutocenter(@ptrCast(@alignCast(haptic)), autocenter)); + } + + pub inline fn pauseHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_PauseHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn resumeHaptic(haptic: *Haptic) bool { + return @bitCast(c.SDL_ResumeHaptic(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn stopHapticEffects(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticEffects(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn hapticRumbleSupported(haptic: *Haptic) bool { + return @bitCast(c.SDL_HapticRumbleSupported(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn initHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_InitHapticRumble(@ptrCast(@alignCast(haptic)))); + } + + pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool { + return @bitCast(c.SDL_PlayHapticRumble(@ptrCast(@alignCast(haptic)), strength, length)); + } + + pub inline fn stopHapticRumble(haptic: *Haptic) bool { + return @bitCast(c.SDL_StopHapticRumble(@ptrCast(@alignCast(haptic)))); + } +}; + +pub const HapticEffectType = u16; + +pub const HapticDirectionType = u8; + +pub const HapticEffectID = c_int; + +pub const HapticDirection = extern struct { + _type: HapticDirectionType, // The type of encoding. + dir: [3]i32, // The encoded direction. +}; + +pub const HapticConstant = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + level: i16, // Strength of the constant effect. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticPeriodic = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + period: u16, // Period of the wave. + magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift. + offset: i16, // Mean value of the wave. + phase: u16, // Positive phase shift given by hundredth of a degree. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticCondition = extern struct { + _type: HapticEffectType, + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF. + left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF. + right_coeff: [3]i16, // How fast to increase the force towards the positive side. + left_coeff: [3]i16, // How fast to increase the force towards the negative side. + deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. + center: [3]i16, // Position of the dead zone. +}; + +pub const HapticRamp = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_RAMP + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + start: i16, // Beginning strength level. + end: i16, // Ending strength level. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticLeftRight = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + length: u32, // Duration of the effect in milliseconds. + large_magnitude: u16, // Control of the large controller motor. + small_magnitude: u16, // Control of the small controller motor. +}; + +pub const HapticCustom = extern struct { + _type: HapticEffectType, // SDL_HAPTIC_CUSTOM + direction: HapticDirection, // Direction of the effect. + length: u32, // Duration of the effect. + delay: u16, // Delay before starting the effect. + button: u16, // Button that triggers the effect. + interval: u16, // How soon it can be triggered again after button. + channels: u8, // Axes to use, minimum of one. + period: u16, // Sample periods. + samples: u16, // Amount of samples. + data: [*c]u16, // Should contain channels*samples items. + attack_length: u16, // Duration of the attack. + attack_level: u16, // Level at the start of the attack. + fade_length: u16, // Duration of the fade. + fade_level: u16, // Level at the end of the fade. +}; + +pub const HapticEffect = extern union { + _type: HapticEffectType, // Effect type. + constant: HapticConstant, // Constant effect. + periodic: HapticPeriodic, // Periodic effect. + condition: HapticCondition, // Condition effect. + ramp: HapticRamp, // Ramp effect. + leftright: HapticLeftRight, // Left/Right effect. + custom: HapticCustom, // Custom effect. +}; + +pub const HapticID = u32; + +pub inline fn getHaptics(count: ?*c_int) ?*HapticID { + return c.SDL_GetHaptics(count); +} + +pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 { + return c.SDL_GetHapticNameForID(instance_id); +} + +pub inline fn openHaptic(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHaptic(instance_id))); +} + +pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_GetHapticFromID(instance_id))); +} + +pub inline fn isMouseHaptic() bool { + return @bitCast(c.SDL_IsMouseHaptic()); +} + +pub inline fn openHapticFromMouse() ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromMouse())); +} + +pub inline fn isJoystickHaptic(joystick: ?*Joystick) bool { + return @bitCast(c.SDL_IsJoystickHaptic(@ptrCast(@alignCast(joystick)))); +} + +pub inline fn openHapticFromJoystick(joystick: ?*Joystick) ?*Haptic { + return @ptrCast(@alignCast(c.SDL_OpenHapticFromJoystick(@ptrCast(@alignCast(joystick))))); +} diff --git a/official/release-3.4.8/api/hints.zig b/official/release-3.4.8/api/hints.zig new file mode 100644 index 0000000..862a596 --- /dev/null +++ b/official/release-3.4.8/api/hints.zig @@ -0,0 +1,41 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const HintPriority = enum(c_int) { + hintDefault, + hintNormal, + hintOverride, +}; + +pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool { + return @bitCast(c.SDL_SetHintWithPriority(name, value, @intCast(@backingInt(priority)))); +} + +pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetHint(name, value)); +} + +pub inline fn resetHint(name: [*c]const u8) bool { + return @bitCast(c.SDL_ResetHint(name)); +} + +pub inline fn resetHints() void { + return c.SDL_ResetHints(); +} + +pub inline fn getHint(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetHint(name); +} + +pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetHintBoolean(name, @bitCast(default_value))); +} + +pub const HintCallback = c.SDL_HintCallback; + +pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_AddHintCallback(name, callback, userdata)); +} + +pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void { + return c.SDL_RemoveHintCallback(name, callback, userdata); +} diff --git a/official/release-3.4.8/api/init.zig b/official/release-3.4.8/api/init.zig new file mode 100644 index 0000000..f2f7c11 --- /dev/null +++ b/official/release-3.4.8/api/init.zig @@ -0,0 +1,75 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const InitFlags = packed struct(u32) { + pad0: u4 = 0, + initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` + initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread + pad1: u3 = 0, + initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` + pad2: u2 = 0, + initHaptic: bool = false, + initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` + initEvents: bool = false, + initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` + initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` + pad3: u14 = 0, + rsvd: bool = false, + + pub const None = InitFlags{}; +}; + +pub const AppResult = enum(c_int) { + appContinue, //Value that requests that the app continue from the main callbacks. + appSuccess, //Value that requests termination with success from the main callbacks. + appFailure, //Value that requests termination with error from the main callbacks. +}; + +pub const AppInit_func = c.SDL_AppInit_func; + +pub const AppIterate_func = c.SDL_AppIterate_func; + +pub const AppEvent_func = c.SDL_AppEvent_func; + +pub const AppQuit_func = c.SDL_AppQuit_func; + +pub inline fn init(flags: InitFlags) bool { + return @bitCast(c.SDL_Init(@bitCast(flags))); +} + +pub inline fn initSubSystem(flags: InitFlags) bool { + return @bitCast(c.SDL_InitSubSystem(@bitCast(flags))); +} + +pub inline fn quitSubSystem(flags: InitFlags) void { + return c.SDL_QuitSubSystem(@bitCast(flags)); +} + +pub inline fn wasInit(flags: InitFlags) InitFlags { + return @bitCast(c.SDL_WasInit(@bitCast(flags))); +} + +pub inline fn quit() void { + return c.SDL_Quit(); +} + +pub inline fn isMainThread() bool { + return @bitCast(c.SDL_IsMainThread()); +} + +pub const MainThreadCallback = c.SDL_MainThreadCallback; + +pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool { + return @bitCast(c.SDL_RunOnMainThread(callback, userdata, @bitCast(wait_complete))); +} + +pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadata(appname, appversion, appidentifier)); +} + +pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetAppMetadataProperty(name, value)); +} + +pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 { + return c.SDL_GetAppMetadataProperty(name); +} diff --git a/official/release-3.4.8/api/iostream.zig b/official/release-3.4.8/api/iostream.zig new file mode 100644 index 0000000..731818c --- /dev/null +++ b/official/release-3.4.8/api/iostream.zig @@ -0,0 +1,221 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const unsupported = struct { + pub const SDL_IOprintf = "varargs function is not representable in Zig"; + pub const SDL_IOvprintf = "varargs function is not representable in Zig"; +}; + +pub const IOStatus = enum(c_int) { + ioStatusReady, //Everything is ready (no errors and not EOF). + ioStatusError, //Read or write I/O error + ioStatusEof, //End of file + ioStatusNotReady, //Non blocking I/O, not ready + ioStatusReadonly, //Tried to write a read-only buffer + ioStatusWriteonly, //Tried to read a write-only buffer +}; + +pub const IOWhence = enum(c_int) { + ioSeekSet, //Seek from the beginning of data + ioSeekCur, //Seek relative to current read point + ioSeekEnd, //Seek relative to the end of data +}; + +pub const IOStreamInterface = extern struct { + version: u32, + size: ?*const fn (?*anyopaque) callconv(.c) i64, + seek: ?*const fn (?*anyopaque, i64, IOWhence) callconv(.c) i64, + read: ?*const fn (?*anyopaque, ?*anyopaque, usize, ?*IOStatus) callconv(.c) usize, + write: ?*const fn (?*anyopaque, ?*const anyopaque, usize, ?*IOStatus) callconv(.c) usize, + flush: ?*const fn (?*anyopaque, ?*IOStatus) callconv(.c) bool, + close: ?*const fn (?*anyopaque) callconv(.c) bool, +}; + +pub const IOStream = opaque { + pub inline fn closeIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_CloseIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn getIOProperties(iostream: *IOStream) PropertiesID { + return c.SDL_GetIOProperties(@ptrCast(@alignCast(iostream))); + } + + pub inline fn getIOStatus(iostream: *IOStream) IOStatus { + return @fromBackingInt(@intCast(c.SDL_GetIOStatus(@ptrCast(@alignCast(iostream))))); + } + + pub inline fn getIOSize(iostream: *IOStream) i64 { + return c.SDL_GetIOSize(@ptrCast(@alignCast(iostream))); + } + + pub inline fn seekIO(iostream: *IOStream, offset: i64, whence: IOWhence) i64 { + return c.SDL_SeekIO(@ptrCast(@alignCast(iostream)), offset, @intCast(@backingInt(whence))); + } + + pub inline fn tellIO(iostream: *IOStream) i64 { + return c.SDL_TellIO(@ptrCast(@alignCast(iostream))); + } + + pub inline fn readIO(iostream: *IOStream, ptr: ?*anyopaque, size: usize) usize { + return c.SDL_ReadIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn writeIO(iostream: *IOStream, ptr: ?*const anyopaque, size: usize) usize { + return c.SDL_WriteIO(@ptrCast(@alignCast(iostream)), ptr, size); + } + + pub inline fn flushIO(iostream: *IOStream) bool { + return @bitCast(c.SDL_FlushIO(@ptrCast(@alignCast(iostream)))); + } + + pub inline fn loadFile_IO(iostream: *IOStream, datasize: ?*usize, closeio: bool) ?*anyopaque { + return c.SDL_LoadFile_IO(@ptrCast(@alignCast(iostream)), datasize, @bitCast(closeio)); + } + + pub inline fn saveFile_IO(iostream: *IOStream, data: ?*const anyopaque, datasize: usize, closeio: bool) bool { + return @bitCast(c.SDL_SaveFile_IO(@ptrCast(@alignCast(iostream)), data, datasize, @bitCast(closeio))); + } + + pub inline fn readU8(iostream: *IOStream, value: [*c]u8) bool { + return @bitCast(c.SDL_ReadU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS8(iostream: *IOStream, value: ?*i8) bool { + return @bitCast(c.SDL_ReadS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16LE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16LE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU16BE(iostream: *IOStream, value: ?*u16) bool { + return @bitCast(c.SDL_ReadU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS16BE(iostream: *IOStream, value: ?*i16) bool { + return @bitCast(c.SDL_ReadS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32LE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32LE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU32BE(iostream: *IOStream, value: ?*u32) bool { + return @bitCast(c.SDL_ReadU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS32BE(iostream: *IOStream, value: ?*i32) bool { + return @bitCast(c.SDL_ReadS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64LE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64LE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readU64BE(iostream: *IOStream, value: ?*u64) bool { + return @bitCast(c.SDL_ReadU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn readS64BE(iostream: *IOStream, value: ?*i64) bool { + return @bitCast(c.SDL_ReadS64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU8(iostream: *IOStream, value: u8) bool { + return @bitCast(c.SDL_WriteU8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS8(iostream: *IOStream, value: i8) bool { + return @bitCast(c.SDL_WriteS8(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16LE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16LE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU16BE(iostream: *IOStream, value: u16) bool { + return @bitCast(c.SDL_WriteU16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS16BE(iostream: *IOStream, value: i16) bool { + return @bitCast(c.SDL_WriteS16BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32LE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32LE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU32BE(iostream: *IOStream, value: u32) bool { + return @bitCast(c.SDL_WriteU32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS32BE(iostream: *IOStream, value: i32) bool { + return @bitCast(c.SDL_WriteS32BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64LE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64LE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64LE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeU64BE(iostream: *IOStream, value: u64) bool { + return @bitCast(c.SDL_WriteU64BE(@ptrCast(@alignCast(iostream)), value)); + } + + pub inline fn writeS64BE(iostream: *IOStream, value: i64) bool { + return @bitCast(c.SDL_WriteS64BE(@ptrCast(@alignCast(iostream)), value)); + } +}; + +pub inline fn ioFromFile(file: [*c]const u8, mode: [*c]const u8) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromFile(file, mode))); +} + +pub inline fn ioFromMem(mem: ?*anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromMem(mem, size))); +} + +pub inline fn ioFromConstMem(mem: ?*const anyopaque, size: usize) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromConstMem(mem, size))); +} + +pub inline fn ioFromDynamicMem() ?*IOStream { + return @ptrCast(@alignCast(c.SDL_IOFromDynamicMem())); +} + +pub inline fn openIO(iface: ?*const IOStreamInterface, userdata: ?*anyopaque) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_OpenIO(@ptrCast(@alignCast(iface)), userdata))); +} + +pub inline fn loadFile(file: [*c]const u8, datasize: ?*usize) ?*anyopaque { + return c.SDL_LoadFile(file, datasize); +} + +pub inline fn saveFile(file: [*c]const u8, data: ?*const anyopaque, datasize: usize) bool { + return @bitCast(c.SDL_SaveFile(file, data, datasize)); +} diff --git a/official/release-3.4.8/api/joystick.zig b/official/release-3.4.8/api/joystick.zig new file mode 100644 index 0000000..a6cee42 --- /dev/null +++ b/official/release-3.4.8/api/joystick.zig @@ -0,0 +1,307 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const sensor_api = @import("sensor.zig"); +const guid_api = @import("guid.zig"); +const power_api = @import("power.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const SensorType = sensor_api.SensorType; +pub const GUID = guid_api.GUID; +pub const PowerState = power_api.PowerState; + +pub const Joystick = opaque { + pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualAxis(@ptrCast(@alignCast(joystick)), axis, value)); + } + + pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool { + return @bitCast(c.SDL_SetJoystickVirtualBall(@ptrCast(@alignCast(joystick)), ball, xrel, yrel)); + } + + pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool { + return @bitCast(c.SDL_SetJoystickVirtualButton(@ptrCast(@alignCast(joystick)), button, @bitCast(down))); + } + + pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool { + return @bitCast(c.SDL_SetJoystickVirtualHat(@ptrCast(@alignCast(joystick)), hat, value)); + } + + pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool { + return @bitCast(c.SDL_SetJoystickVirtualTouchpad(@ptrCast(@alignCast(joystick)), touchpad, finger, @bitCast(down), x, y, pressure)); + } + + pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool { + return @bitCast(c.SDL_SendJoystickVirtualSensorData(@ptrCast(@alignCast(joystick)), @intCast(@backingInt(_type)), sensor_timestamp, data, num_values)); + } + + pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID { + return c.SDL_GetJoystickProperties(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickName(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickPath(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int { + return c.SDL_GetJoystickPlayerIndex(@ptrCast(@alignCast(joystick))); + } + + pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool { + return @bitCast(c.SDL_SetJoystickPlayerIndex(@ptrCast(@alignCast(joystick)), player_index)); + } + + pub inline fn getJoystickGUID(joystick: *Joystick) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUID(@ptrCast(@alignCast(joystick)))))).*; + } + + pub inline fn getJoystickVendor(joystick: *Joystick) u16 { + return c.SDL_GetJoystickVendor(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProduct(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProduct(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickProductVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 { + return c.SDL_GetJoystickFirmwareVersion(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 { + return c.SDL_GetJoystickSerial(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickType(joystick: *Joystick) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickType(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn joystickConnected(joystick: *Joystick) bool { + return @bitCast(c.SDL_JoystickConnected(@ptrCast(@alignCast(joystick)))); + } + + pub inline fn getJoystickID(joystick: *Joystick) JoystickID { + return c.SDL_GetJoystickID(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickAxes(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickBalls(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickHats(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickHats(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int { + return c.SDL_GetNumJoystickButtons(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 { + return c.SDL_GetJoystickAxis(@ptrCast(@alignCast(joystick)), axis); + } + + pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: ?*i16) bool { + return @bitCast(c.SDL_GetJoystickAxisInitialState(@ptrCast(@alignCast(joystick)), axis, state)); + } + + pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: ?*c_int, dy: ?*c_int) bool { + return @bitCast(c.SDL_GetJoystickBall(@ptrCast(@alignCast(joystick)), ball, dx, dy)); + } + + pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 { + return c.SDL_GetJoystickHat(@ptrCast(@alignCast(joystick)), hat); + } + + pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool { + return @bitCast(c.SDL_GetJoystickButton(@ptrCast(@alignCast(joystick)), button)); + } + + pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystick(@ptrCast(@alignCast(joystick)), low_frequency_rumble, high_frequency_rumble, duration_ms)); + } + + pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool { + return @bitCast(c.SDL_RumbleJoystickTriggers(@ptrCast(@alignCast(joystick)), left_rumble, right_rumble, duration_ms)); + } + + pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool { + return @bitCast(c.SDL_SetJoystickLED(@ptrCast(@alignCast(joystick)), red, green, blue)); + } + + pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool { + return @bitCast(c.SDL_SendJoystickEffect(@ptrCast(@alignCast(joystick)), data, size)); + } + + pub inline fn closeJoystick(joystick: *Joystick) void { + return c.SDL_CloseJoystick(@ptrCast(@alignCast(joystick))); + } + + pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickConnectionState(@ptrCast(@alignCast(joystick))))); + } + + pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetJoystickPowerInfo(@ptrCast(@alignCast(joystick)), percent))); + } +}; + +pub const JoystickID = u32; + +pub const JoystickType = enum(c_int) { + joystickTypeUnknown, + joystickTypeGamepad, + joystickTypeWheel, + joystickTypeArcadeStick, + joystickTypeFlightStick, + joystickTypeDancePad, + joystickTypeGuitar, + joystickTypeDrumKit, + joystickTypeArcadePad, + joystickTypeThrottle, + joystickTypeCount, +}; + +pub const JoystickConnectionState = enum(c_int) { + joystickConnectionInvalid = -1, + joystickConnectionUnknown, + joystickConnectionWired, + joystickConnectionWireless, +}; + +pub inline fn lockJoysticks() void { + return c.SDL_LockJoysticks(); +} + +pub inline fn unlockJoysticks() void { + return c.SDL_UnlockJoysticks(); +} + +pub inline fn hasJoystick() bool { + return @bitCast(c.SDL_HasJoystick()); +} + +pub inline fn getJoysticks(count: ?*c_int) ?*JoystickID { + return c.SDL_GetJoysticks(count); +} + +pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickNameForID(instance_id); +} + +pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 { + return c.SDL_GetJoystickPathForID(instance_id); +} + +pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int { + return c.SDL_GetJoystickPlayerIndexForID(instance_id); +} + +pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID { + return @as(*const GUID, @ptrCast(@alignCast(&c.SDL_GetJoystickGUIDForID(instance_id)))).*; +} + +pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickVendorForID(instance_id); +} + +pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductForID(instance_id); +} + +pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 { + return c.SDL_GetJoystickProductVersionForID(instance_id); +} + +pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType { + return @fromBackingInt(@intCast(c.SDL_GetJoystickTypeForID(instance_id))); +} + +pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_OpenJoystick(instance_id))); +} + +pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromID(instance_id))); +} + +pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick { + return @ptrCast(@alignCast(c.SDL_GetJoystickFromPlayerIndex(player_index))); +} + +pub const VirtualJoystickTouchpadDesc = extern struct { + nfingers: u16, // the number of simultaneous fingers on this touchpad + padding: [3]u16, +}; + +pub const VirtualJoystickSensorDesc = extern struct { + _type: SensorType, // the type of this sensor + rate: f32, // the update frequency of this sensor, may be 0.0f +}; + +pub const VirtualJoystickDesc = extern struct { + version: u32, // the version of this interface + _type: u16, // `SDL_JoystickType` + padding: u16, // unused + vendor_id: u16, // the USB vendor ID of this joystick + product_id: u16, // the USB product ID of this joystick + naxes: u16, // the number of axes on this joystick + nbuttons: u16, // the number of buttons on this joystick + nballs: u16, // the number of balls on this joystick + nhats: u16, // the number of hats on this joystick + ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions + nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions + padding2: [2]u16, // unused + button_mask: u32, + axis_mask: u32, + name: [*c]const u8, // the name of the joystick + touchpads: [*c]const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 + sensors: [*c]const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0 + userdata: ?*anyopaque, // User data pointer passed to callbacks + Update: ?*const fn (?*anyopaque) callconv(.c) void, // Called when the joystick state should be updated + SetPlayerIndex: ?*const fn (?*anyopaque, c_int) callconv(.c) void, // Called when the player index is set + Rumble: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystick() + RumbleTriggers: ?*const fn (?*anyopaque, u16, u16) callconv(.c) bool, // Implements SDL_RumbleJoystickTriggers() + SetLED: ?*const fn (?*anyopaque, u8, u8, u8) callconv(.c) bool, // Implements SDL_SetJoystickLED() + SendEffect: ?*const fn (?*anyopaque, ?*const anyopaque, c_int) callconv(.c) bool, // Implements SDL_SendJoystickEffect() + SetSensorsEnabled: ?*const fn (?*anyopaque, bool) callconv(.c) bool, // Implements SDL_SetGamepadSensorEnabled() + Cleanup: ?*const fn (?*anyopaque) callconv(.c) void, // Cleans up the userdata when the joystick is detached +}; + +pub inline fn attachVirtualJoystick(desc: ?*const VirtualJoystickDesc) JoystickID { + return c.SDL_AttachVirtualJoystick(@ptrCast(@alignCast(desc))); +} + +pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool { + return @bitCast(c.SDL_DetachVirtualJoystick(instance_id)); +} + +pub inline fn isJoystickVirtual(instance_id: JoystickID) bool { + return @bitCast(c.SDL_IsJoystickVirtual(instance_id)); +} + +pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: ?*u16, product: ?*u16, version: ?*u16, crc16: ?*u16) void { + return c.SDL_GetJoystickGUIDInfo(@as(*const c.SDL_GUID, @ptrCast(@alignCast(&guid))).*, vendor, product, version, crc16); +} + +pub inline fn setJoystickEventsEnabled(enabled: bool) void { + return c.SDL_SetJoystickEventsEnabled(@bitCast(enabled)); +} + +pub inline fn joystickEventsEnabled() bool { + return @bitCast(c.SDL_JoystickEventsEnabled()); +} + +pub inline fn updateJoysticks() void { + return c.SDL_UpdateJoysticks(); +} diff --git a/official/release-3.4.8/api/keyboard.zig b/official/release-3.4.8/api/keyboard.zig new file mode 100644 index 0000000..7c4275d --- /dev/null +++ b/official/release-3.4.8/api/keyboard.zig @@ -0,0 +1,131 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const scancode_api = @import("scancode.zig"); +const video_api = @import("video.zig"); +const keycode_api = @import("keycode.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const Scancode = scancode_api.Scancode; +pub const Window = video_api.Window; +pub const Keymod = keycode_api.Keymod; +pub const Rect = rect_api.Rect; +pub const Keycode = keycode_api.Keycode; +pub const PropertiesID = properties_api.PropertiesID; + +pub const KeyboardID = u32; + +pub inline fn hasKeyboard() bool { + return @bitCast(c.SDL_HasKeyboard()); +} + +pub inline fn getKeyboards(count: ?*c_int) ?*KeyboardID { + return c.SDL_GetKeyboards(count); +} + +pub inline fn getKeyboardNameForID(instance_id: KeyboardID) [*c]const u8 { + return c.SDL_GetKeyboardNameForID(instance_id); +} + +pub inline fn getKeyboardFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetKeyboardFocus())); +} + +pub inline fn getKeyboardState(numkeys: ?*c_int) *const bool { + return @ptrCast(@alignCast(c.SDL_GetKeyboardState(numkeys))); +} + +pub inline fn resetKeyboard() void { + return c.SDL_ResetKeyboard(); +} + +pub inline fn getModState() Keymod { + return c.SDL_GetModState(); +} + +pub inline fn setModState(modstate: Keymod) void { + return c.SDL_SetModState(modstate); +} + +pub inline fn getKeyFromScancode(scancode: Scancode, modstate: Keymod, key_event: bool) Keycode { + return c.SDL_GetKeyFromScancode(@intCast(@backingInt(scancode)), modstate, @bitCast(key_event)); +} + +pub inline fn getScancodeFromKey(key: Keycode, modstate: ?*Keymod) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromKey(key, modstate))); +} + +pub inline fn setScancodeName(scancode: Scancode, name: [*c]const u8) bool { + return @bitCast(c.SDL_SetScancodeName(@intCast(@backingInt(scancode)), name)); +} + +pub inline fn getScancodeName(scancode: Scancode) [*c]const u8 { + return c.SDL_GetScancodeName(@intCast(@backingInt(scancode))); +} + +pub inline fn getScancodeFromName(name: [*c]const u8) Scancode { + return @fromBackingInt(@intCast(c.SDL_GetScancodeFromName(name))); +} + +pub inline fn getKeyName(key: Keycode) [*c]const u8 { + return c.SDL_GetKeyName(key); +} + +pub inline fn getKeyFromName(name: [*c]const u8) Keycode { + return c.SDL_GetKeyFromName(name); +} + +pub inline fn startTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StartTextInput(@ptrCast(@alignCast(window)))); +} + +pub const TextInputType = enum(c_int) { + textinputTypeText, //The input is text + textinputTypeTextName, //The input is a person's name + textinputTypeTextEmail, //The input is an e-mail address + textinputTypeTextUsername, //The input is a username + textinputTypeTextPasswordHidden, //The input is a secure password that is hidden + textinputTypeTextPasswordVisible, //The input is a secure password that is visible + textinputTypeNumber, //The input is a number + textinputTypeNumberPasswordHidden, //The input is a secure PIN that is hidden + textinputTypeNumberPasswordVisible, //The input is a secure PIN that is visible +}; + +pub const Capitalization = enum(c_int) { + capitalizeNone, //No auto-capitalization will be done + capitalizeSentences, //The first letter of sentences will be capitalized + capitalizeWords, //The first letter of words will be capitalized + capitalizeLetters, //All letters will be capitalized +}; + +pub inline fn startTextInputWithProperties(window: ?*Window, props: PropertiesID) bool { + return @bitCast(c.SDL_StartTextInputWithProperties(@ptrCast(@alignCast(window)), props)); +} + +pub inline fn textInputActive(window: ?*Window) bool { + return @bitCast(c.SDL_TextInputActive(@ptrCast(@alignCast(window)))); +} + +pub inline fn stopTextInput(window: ?*Window) bool { + return @bitCast(c.SDL_StopTextInput(@ptrCast(@alignCast(window)))); +} + +pub inline fn clearComposition(window: ?*Window) bool { + return @bitCast(c.SDL_ClearComposition(@ptrCast(@alignCast(window)))); +} + +pub inline fn setTextInputArea(window: ?*Window, rect: ?*const Rect, cursor: c_int) bool { + return @bitCast(c.SDL_SetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn getTextInputArea(window: ?*Window, rect: ?*Rect, cursor: ?*c_int) bool { + return @bitCast(c.SDL_GetTextInputArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)), cursor)); +} + +pub inline fn hasScreenKeyboardSupport() bool { + return @bitCast(c.SDL_HasScreenKeyboardSupport()); +} + +pub inline fn screenKeyboardShown(window: ?*Window) bool { + return @bitCast(c.SDL_ScreenKeyboardShown(@ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.8/api/keycode.zig b/official/release-3.4.8/api/keycode.zig new file mode 100644 index 0000000..8a6faae --- /dev/null +++ b/official/release-3.4.8/api/keycode.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Keycode = u32; + +pub const Keymod = u16; diff --git a/official/release-3.4.8/api/loadso.zig b/official/release-3.4.8/api/loadso.zig new file mode 100644 index 0000000..aa318c0 --- /dev/null +++ b/official/release-3.4.8/api/loadso.zig @@ -0,0 +1,19 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const SharedObject = opaque { + pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer { + return c.SDL_LoadFunction(@ptrCast(@alignCast(sharedobject)), name); + } + + pub inline fn unloadObject(sharedobject: *SharedObject) void { + return c.SDL_UnloadObject(@ptrCast(@alignCast(sharedobject))); + } +}; + +pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject { + return @ptrCast(@alignCast(c.SDL_LoadObject(sofile))); +} diff --git a/official/release-3.4.8/api/messagebox.zig b/official/release-3.4.8/api/messagebox.zig new file mode 100644 index 0000000..84c5f01 --- /dev/null +++ b/official/release-3.4.8/api/messagebox.zig @@ -0,0 +1,70 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const Window = video_api.Window; + +pub const MessageBoxFlags = packed struct(u32) { + pad0: u4 = 0, + messageboxError: bool = false, // error dialog + messageboxWarning: bool = false, // warning dialog + messageboxInformation: bool = false, // informational dialog + messageboxButtonsLeftToRight: bool = false, // buttons placed left to right + messageboxButtonsRightToLeft: bool = false, // buttons placed right to left + pad1: u22 = 0, + rsvd: bool = false, + + pub const None = MessageBoxFlags{}; +}; + +pub const MessageBoxButtonFlags = packed struct(u32) { + messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit + messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = MessageBoxButtonFlags{}; +}; + +pub const MessageBoxButtonData = extern struct { + flags: MessageBoxButtonFlags, + buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox) + text: [*c]const u8, // The UTF-8 button text +}; + +pub const MessageBoxColor = extern struct { + r: u8, + g: u8, + b: u8, +}; + +pub const MessageBoxColorType = enum(c_int) { + messageboxColorBackground, + messageboxColorText, + messageboxColorButtonBorder, + messageboxColorButtonBackground, + messageboxColorButtonSelected, + messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme. +}; + +pub const MessageBoxColorScheme = extern struct { + colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor, +}; + +pub const MessageBoxData = extern struct { + flags: MessageBoxFlags, + window: ?*Window, // Parent window, can be NULL + title: [*c]const u8, // UTF-8 title + message: [*c]const u8, // UTF-8 message text + numbuttons: c_int, + buttons: [*c]const MessageBoxButtonData, + colorScheme: [*c]const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings +}; + +pub inline fn showMessageBox(messageboxdata: ?*const MessageBoxData, buttonid: ?*c_int) bool { + return @bitCast(c.SDL_ShowMessageBox(@ptrCast(@alignCast(messageboxdata)), buttonid)); +} + +pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool { + return @bitCast(c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, @ptrCast(@alignCast(window)))); +} diff --git a/official/release-3.4.8/api/misc.zig b/official/release-3.4.8/api/misc.zig new file mode 100644 index 0000000..c557052 --- /dev/null +++ b/official/release-3.4.8/api/misc.zig @@ -0,0 +1,5 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn openURL(url: [*c]const u8) bool { + return @bitCast(c.SDL_OpenURL(url)); +} diff --git a/official/release-3.4.8/api/mouse.zig b/official/release-3.4.8/api/mouse.zig new file mode 100644 index 0000000..08095af --- /dev/null +++ b/official/release-3.4.8/api/mouse.zig @@ -0,0 +1,155 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); +const surface_api = @import("surface.zig"); + +pub const Window = video_api.Window; +pub const Surface = surface_api.Surface; + +pub const MouseID = u32; + +pub const Cursor = opaque { + pub inline fn setCursor(cursor: *Cursor) bool { + return @bitCast(c.SDL_SetCursor(@ptrCast(@alignCast(cursor)))); + } + + pub inline fn destroyCursor(cursor: *Cursor) void { + return c.SDL_DestroyCursor(@ptrCast(@alignCast(cursor))); + } +}; + +pub const SystemCursor = enum(c_int) { + systemCursorDefault, //Default cursor. Usually an arrow. + systemCursorText, //Text selection. Usually an I-beam. + systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball. + systemCursorCrosshair, //Crosshair. + systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow. + systemCursorNwseResize, //Double arrow pointing northwest and southeast. + systemCursorNeswResize, //Double arrow pointing northeast and southwest. + systemCursorEwResize, //Double arrow pointing west and east. + systemCursorNsResize, //Double arrow pointing north and south. + systemCursorMove, //Four pointed arrow pointing north, south, east, and west. + systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones. + systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand. + systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. + systemCursorNResize, //Window resize top. May be NS_RESIZE. + systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE. + systemCursorEResize, //Window resize right. May be EW_RESIZE. + systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE. + systemCursorSResize, //Window resize bottom. May be NS_RESIZE. + systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE. + systemCursorWResize, //Window resize left. May be EW_RESIZE. + systemCursorCount, +}; + +pub const MouseWheelDirection = enum(c_int) { + mousewheelNormal, //The scroll direction is normal + mousewheelFlipped, //The scroll direction is flipped / natural +}; + +pub const CursorFrameInfo = extern struct { + surface: ?*Surface, // The surface data for this frame + duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) +}; + +pub const MouseButtonFlags = packed struct(u32) { + buttonLeft: bool = false, + buttonMiddle: bool = false, + buttonX1: bool = false, + pad0: u28 = 0, + rsvd: bool = false, + + pub const None = MouseButtonFlags{}; + pub const ButtonRight: MouseButtonFlags = @bitCast(@as(u32, 3)); + pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); +}; + +pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; + +pub inline fn hasMouse() bool { + return @bitCast(c.SDL_HasMouse()); +} + +pub inline fn getMice(count: ?*c_int) ?*MouseID { + return c.SDL_GetMice(count); +} + +pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 { + return c.SDL_GetMouseNameForID(instance_id); +} + +pub inline fn getMouseFocus() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetMouseFocus())); +} + +pub inline fn getMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetMouseState(x, y)); +} + +pub inline fn getGlobalMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetGlobalMouseState(x, y)); +} + +pub inline fn getRelativeMouseState(x: ?*f32, y: ?*f32) MouseButtonFlags { + return @bitCast(c.SDL_GetRelativeMouseState(x, y)); +} + +pub inline fn warpMouseInWindow(window: ?*Window, x: f32, y: f32) void { + return c.SDL_WarpMouseInWindow(@ptrCast(@alignCast(window)), x, y); +} + +pub inline fn warpMouseGlobal(x: f32, y: f32) bool { + return @bitCast(c.SDL_WarpMouseGlobal(x, y)); +} + +pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); +} + +pub inline fn setWindowRelativeMouseMode(window: ?*Window, enabled: bool) bool { + return @bitCast(c.SDL_SetWindowRelativeMouseMode(@ptrCast(@alignCast(window)), @bitCast(enabled))); +} + +pub inline fn getWindowRelativeMouseMode(window: ?*Window) bool { + return @bitCast(c.SDL_GetWindowRelativeMouseMode(@ptrCast(@alignCast(window)))); +} + +pub inline fn captureMouse(enabled: bool) bool { + return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); +} + +pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y))); +} + +pub inline fn createColorCursor(surface: ?*Surface, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateColorCursor(@ptrCast(@alignCast(surface)), hot_x, hot_y))); +} + +pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateAnimatedCursor(@ptrCast(@alignCast(frames)), frame_count, hot_x, hot_y))); +} + +pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { + return @ptrCast(@alignCast(c.SDL_CreateSystemCursor(@intCast(@backingInt(id))))); +} + +pub inline fn getCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetCursor())); +} + +pub inline fn getDefaultCursor() ?*Cursor { + return @ptrCast(@alignCast(c.SDL_GetDefaultCursor())); +} + +pub inline fn showCursor() bool { + return @bitCast(c.SDL_ShowCursor()); +} + +pub inline fn hideCursor() bool { + return @bitCast(c.SDL_HideCursor()); +} + +pub inline fn cursorVisible() bool { + return @bitCast(c.SDL_CursorVisible()); +} diff --git a/official/release-3.4.8/api/opengl.zig b/official/release-3.4.8/api/opengl.zig new file mode 100644 index 0000000..c1f53b9 --- /dev/null +++ b/official/release-3.4.8/api/opengl.zig @@ -0,0 +1,2 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; diff --git a/official/release-3.4.8/api/pen.zig b/official/release-3.4.8/api/pen.zig new file mode 100644 index 0000000..c21ac67 --- /dev/null +++ b/official/release-3.4.8/api/pen.zig @@ -0,0 +1,39 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PenID = u32; + +pub const PenInputFlags = packed struct(u32) { + penInputDown: bool = false, // pen is pressed down + penInputButton1: bool = false, // button 1 is pressed + penInputButton2: bool = false, // button 2 is pressed + penInputButton3: bool = false, // button 3 is pressed + penInputButton4: bool = false, // button 4 is pressed + penInputButton5: bool = false, // button 5 is pressed + pad0: u24 = 0, + penInputEraserTip: bool = false, // eraser tip is used + penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) + + pub const None = PenInputFlags{}; +}; + +pub const PenAxis = enum(c_int) { + penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0 + penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 + penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). + penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 + penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure"). + penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases! +}; + +pub const PenDeviceType = enum(c_int) { + penDeviceTypeInvalid = -1, //Not a valid pen device. + penDeviceTypeUnknown, //Don't know specifics of this pen. + penDeviceTypeDirect, //Pen touches display. + penDeviceTypeIndirect, //Pen touches something that isn't the display. +}; + +pub inline fn getPenDeviceType(instance_id: PenID) PenDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetPenDeviceType(instance_id))); +} diff --git a/official/release-3.4.8/api/pixels.zig b/official/release-3.4.8/api/pixels.zig new file mode 100644 index 0000000..2c7783d --- /dev/null +++ b/official/release-3.4.8/api/pixels.zig @@ -0,0 +1,311 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PixelType = enum(c_int) { + pixeltypeUnknown, + pixeltypeIndex1, + pixeltypeIndex4, + pixeltypeIndex8, + pixeltypePacked8, + pixeltypePacked16, + pixeltypePacked32, + pixeltypeArrayu8, + pixeltypeArrayu16, + pixeltypeArrayu32, + pixeltypeArrayf16, + pixeltypeArrayf32, + pixeltypeIndex2, +}; + +pub const BitmapOrder = enum(c_int) { + bitmaporderNone, + bitmaporder4321, + bitmaporder1234, +}; + +pub const PackedOrder = enum(c_int) { + packedorderNone, + packedorderXrgb, + packedorderRgbx, + packedorderArgb, + packedorderRgba, + packedorderXbgr, + packedorderBgrx, + packedorderAbgr, + packedorderBgra, +}; + +pub const ArrayOrder = enum(c_int) { + arrayorderNone, + arrayorderRgb, + arrayorderRgba, + arrayorderArgb, + arrayorderBgr, + arrayorderBgra, + arrayorderAbgr, +}; + +pub const PackedLayout = enum(c_int) { + packedlayoutNone, + packedlayout332, + packedlayout4444, + packedlayout1555, + packedlayout5551, + packedlayout565, + packedlayout8888, + packedlayout2101010, + packedlayout1010102, +}; + +pub const PixelFormat = enum(c_int) { + pixelformatUnknown = 0, + pixelformatIndex1lsb = 0x11100100, + pixelformatIndex1msb = 0x11200100, + pixelformatIndex2lsb = 0x1c100200, + pixelformatIndex2msb = 0x1c200200, + pixelformatIndex4lsb = 0x12100400, + pixelformatIndex4msb = 0x12200400, + pixelformatIndex8 = 0x13000801, + pixelformatRgb332 = 0x14110801, + pixelformatXrgb4444 = 0x15120c02, + pixelformatXbgr4444 = 0x15520c02, + pixelformatXrgb1555 = 0x15130f02, + pixelformatXbgr1555 = 0x15530f02, + pixelformatArgb4444 = 0x15321002, + pixelformatRgba4444 = 0x15421002, + pixelformatAbgr4444 = 0x15721002, + pixelformatBgra4444 = 0x15821002, + pixelformatArgb1555 = 0x15331002, + pixelformatRgba5551 = 0x15441002, + pixelformatAbgr1555 = 0x15731002, + pixelformatBgra5551 = 0x15841002, + pixelformatRgb565 = 0x15151002, + pixelformatBgr565 = 0x15551002, + pixelformatRgb24 = 0x17101803, + pixelformatBgr24 = 0x17401803, + pixelformatXrgb8888 = 0x16161804, + pixelformatRgbx8888 = 0x16261804, + pixelformatXbgr8888 = 0x16561804, + pixelformatBgrx8888 = 0x16661804, + pixelformatArgb8888 = 0x16362004, + pixelformatRgba8888 = 0x16462004, + pixelformatAbgr8888 = 0x16762004, + pixelformatBgra8888 = 0x16862004, + pixelformatXrgb2101010 = 0x16172004, + pixelformatXbgr2101010 = 0x16572004, + pixelformatArgb2101010 = 0x16372004, + pixelformatAbgr2101010 = 0x16772004, + pixelformatRgb48 = 0x18103006, + pixelformatBgr48 = 0x18403006, + pixelformatRgba64 = 0x18204008, + pixelformatArgb64 = 0x18304008, + pixelformatBgra64 = 0x18504008, + pixelformatAbgr64 = 0x18604008, + pixelformatRgb48Float = 0x1a103006, + pixelformatBgr48Float = 0x1a403006, + pixelformatRgba64Float = 0x1a204008, + pixelformatArgb64Float = 0x1a304008, + pixelformatBgra64Float = 0x1a504008, + pixelformatAbgr64Float = 0x1a604008, + pixelformatRgb96Float = 0x1b10600c, + pixelformatBgr96Float = 0x1b40600c, + pixelformatRgba128Float = 0x1b208010, + pixelformatArgb128Float = 0x1b308010, + pixelformatBgra128Float = 0x1b508010, + pixelformatAbgr128Float = 0x1b608010, + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format + pixelformatMjpg = 0x47504a4d, //Motion JPEG + + pub const pixelformatRgba32 = .pixelformatAbgr8888; + pub const pixelformatArgb32 = .pixelformatBgra8888; + pub const pixelformatBgra32 = .pixelformatArgb8888; + pub const pixelformatAbgr32 = .pixelformatRgba8888; + pub const pixelformatRgbx32 = .pixelformatXbgr8888; + pub const pixelformatXrgb32 = .pixelformatBgrx8888; + pub const pixelformatBgrx32 = .pixelformatXrgb8888; + pub const pixelformatXbgr32 = .pixelformatRgbx8888; +}; + +pub const ColorType = enum(c_int) { + colorTypeUnknown = 0, + colorTypeRgb = 1, + colorTypeYcbcr = 2, +}; + +pub const ColorRange = enum(c_int) { + colorRangeUnknown = 0, + colorRangeLimited = 1, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma + colorRangeFull = 2, //Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma +}; + +pub const ColorPrimaries = enum(c_int) { + colorPrimariesUnknown = 0, + colorPrimariesBt709 = 1, //ITU-R BT.709-6 + colorPrimariesUnspecified = 2, + colorPrimariesBt470m = 4, //ITU-R BT.470-6 System M + colorPrimariesBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 + colorPrimariesBt601 = 6, //ITU-R BT.601-7 525, SMPTE 170M + colorPrimariesSmpte240 = 7, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 + colorPrimariesGenericFilm = 8, //Generic film (color filters using Illuminant C) + colorPrimariesBt2020 = 9, //ITU-R BT.2020-2 / ITU-R BT.2100-0 + colorPrimariesXyz = 10, //SMPTE ST 428-1 + colorPrimariesSmpte431 = 11, //SMPTE RP 431-2 + colorPrimariesSmpte432 = 12, //SMPTE EG 432-1 / DCI P3 + colorPrimariesEbu3213 = 22, //EBU Tech. 3213-E + colorPrimariesCustom = 31, +}; + +pub const TransferCharacteristics = enum(c_int) { + transferCharacteristicsUnknown = 0, + transferCharacteristicsBt709 = 1, //Rec. ITU-R BT.709-6 / ITU-R BT1361 + transferCharacteristicsUnspecified = 2, + transferCharacteristicsGamma22 = 4, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM + transferCharacteristicsGamma28 = 5, //ITU-R BT.470-6 System B, G + transferCharacteristicsBt601 = 6, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625 + transferCharacteristicsSmpte240 = 7, //SMPTE ST 240M + transferCharacteristicsLinear = 8, + transferCharacteristicsLog100 = 9, + transferCharacteristicsLog100Sqrt10 = 10, + transferCharacteristicsIec61966 = 11, //IEC 61966-2-4 + transferCharacteristicsBt1361 = 12, //ITU-R BT1361 Extended Colour Gamut + transferCharacteristicsSrgb = 13, //IEC 61966-2-1 (sRGB or sYCC) + transferCharacteristicsBt202010bit = 14, //ITU-R BT2020 for 10-bit system + transferCharacteristicsBt202012bit = 15, //ITU-R BT2020 for 12-bit system + transferCharacteristicsPq = 16, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + transferCharacteristicsSmpte428 = 17, //SMPTE ST 428-1 + transferCharacteristicsHlg = 18, //ARIB STD-B67, known as "hybrid log-gamma" (HLG) + transferCharacteristicsCustom = 31, +}; + +pub const MatrixCoefficients = enum(c_int) { + matrixCoefficientsIdentity = 0, + matrixCoefficientsBt709 = 1, //ITU-R BT.709-6 + matrixCoefficientsUnspecified = 2, + matrixCoefficientsFcc = 4, //US FCC Title 47 + matrixCoefficientsBt470bg = 5, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 + matrixCoefficientsBt601 = 6, //ITU-R BT.601-7 525 + matrixCoefficientsSmpte240 = 7, //SMPTE 240M + matrixCoefficientsYcgco = 8, + matrixCoefficientsBt2020Ncl = 9, //ITU-R BT.2020-2 non-constant luminance + matrixCoefficientsBt2020Cl = 10, //ITU-R BT.2020-2 constant luminance + matrixCoefficientsSmpte2085 = 11, //SMPTE ST 2085 + matrixCoefficientsChromaDerivedNcl = 12, + matrixCoefficientsChromaDerivedCl = 13, + matrixCoefficientsIctcp = 14, //ITU-R BT.2100-0 ICTCP + matrixCoefficientsCustom = 31, +}; + +pub const ChromaLocation = enum(c_int) { + chromaLocationNone = 0, //RGB, no chroma sampling + chromaLocationLeft = 1, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. + chromaLocationCenter = 2, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. + chromaLocationTopleft = 3, //In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). +}; + +pub const Colorspace = enum(c_int) { + colorspaceUnknown = 0, + colorspaceSrgb = 0x120005a0, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + colorspaceSrgbLinear = 0x12000500, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + colorspaceHdr10 = 0x12002600, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + colorspaceJpeg = 0x220004c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + colorspaceBt601Limited = 0x211018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt601Full = 0x221018c6, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + colorspaceBt709Limited = 0x21100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt709Full = 0x22100421, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + colorspaceBt2020Limited = 0x21102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + + pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified +}; + +pub const Color = extern struct { + r: u8, + g: u8, + b: u8, + a: u8, +}; + +pub const FColor = extern struct { + r: f32, + g: f32, + b: f32, + a: f32, +}; + +pub const Palette = extern struct { + ncolors: c_int, // number of elements in `colors`. + colors: [*c]Color, // an array of colors, `ncolors` long. + version: u32, // internal use only, do not touch. + refcount: c_int, // internal use only, do not touch. +}; + +pub const PixelFormatDetails = extern struct { + format: PixelFormat, + bits_per_pixel: u8, + bytes_per_pixel: u8, + padding: [2]u8, + Rmask: u32, + Gmask: u32, + Bmask: u32, + Amask: u32, + Rbits: u8, + Gbits: u8, + Bbits: u8, + Abits: u8, + Rshift: u8, + Gshift: u8, + Bshift: u8, + Ashift: u8, +}; + +pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 { + return c.SDL_GetPixelFormatName(@intCast(@backingInt(format))); +} + +pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: ?*c_int, Rmask: ?*u32, Gmask: ?*u32, Bmask: ?*u32, Amask: ?*u32) bool { + return @bitCast(c.SDL_GetMasksForPixelFormat(@intCast(@backingInt(format)), bpp, Rmask, Gmask, Bmask, Amask)); +} + +pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask))); +} + +pub inline fn getPixelFormatDetails(format: PixelFormat) ?*const PixelFormatDetails { + return @ptrCast(@alignCast(c.SDL_GetPixelFormatDetails(@intCast(@backingInt(format))))); +} + +pub inline fn createPalette(ncolors: c_int) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreatePalette(ncolors))); +} + +pub inline fn setPaletteColors(palette: ?*Palette, colors: ?*const Color, firstcolor: c_int, ncolors: c_int) bool { + return @bitCast(c.SDL_SetPaletteColors(@ptrCast(@alignCast(palette)), @ptrCast(@alignCast(colors)), firstcolor, ncolors)); +} + +pub inline fn destroyPalette(palette: ?*Palette) void { + return c.SDL_DestroyPalette(@ptrCast(@alignCast(palette))); +} + +pub inline fn mapRGB(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapRGB(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palette, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapRGBA(@ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} + +pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { + return c.SDL_GetRGB(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b); +} + +pub inline fn getRGBA(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { + return c.SDL_GetRGBA(pixelvalue, @ptrCast(@alignCast(format)), @ptrCast(@alignCast(palette)), r, g, b, a); +} diff --git a/official/release-3.4.8/api/power.zig b/official/release-3.4.8/api/power.zig new file mode 100644 index 0000000..8d64b90 --- /dev/null +++ b/official/release-3.4.8/api/power.zig @@ -0,0 +1,14 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PowerState = enum(c_int) { + powerstateError = -1, //error determining power status + powerstateUnknown, //cannot determine power status + powerstateOnBattery, //Not plugged in, running on the battery + powerstateNoBattery, //Plugged in, no battery available + powerstateCharging, //Plugged in, charging battery + powerstateCharged, //Plugged in, battery charged +}; + +pub inline fn getPowerInfo(seconds: ?*c_int, percent: ?*c_int) PowerState { + return @fromBackingInt(@intCast(c.SDL_GetPowerInfo(seconds, percent))); +} diff --git a/official/release-3.4.8/api/process.zig b/official/release-3.4.8/api/process.zig new file mode 100644 index 0000000..fb73f1f --- /dev/null +++ b/official/release-3.4.8/api/process.zig @@ -0,0 +1,52 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); +const iostream_api = @import("iostream.zig"); + +pub const PropertiesID = properties_api.PropertiesID; +pub const IOStream = iostream_api.IOStream; + +pub const Process = opaque { + pub inline fn getProcessProperties(process: *Process) PropertiesID { + return c.SDL_GetProcessProperties(@ptrCast(@alignCast(process))); + } + + pub inline fn readProcess(process: *Process, datasize: ?*usize, exitcode: ?*c_int) ?*anyopaque { + return c.SDL_ReadProcess(@ptrCast(@alignCast(process)), datasize, exitcode); + } + + pub inline fn getProcessInput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessInput(@ptrCast(@alignCast(process))))); + } + + pub inline fn getProcessOutput(process: *Process) ?*IOStream { + return @ptrCast(@alignCast(c.SDL_GetProcessOutput(@ptrCast(@alignCast(process))))); + } + + pub inline fn killProcess(process: *Process, force: bool) bool { + return @bitCast(c.SDL_KillProcess(@ptrCast(@alignCast(process)), @bitCast(force))); + } + + pub inline fn waitProcess(process: *Process, block: bool, exitcode: ?*c_int) bool { + return @bitCast(c.SDL_WaitProcess(@ptrCast(@alignCast(process)), @bitCast(block), exitcode)); + } + + pub inline fn destroyProcess(process: *Process) void { + return c.SDL_DestroyProcess(@ptrCast(@alignCast(process))); + } +}; + +pub inline fn createProcess(args: [*c]const [*c]const u8, pipe_stdio: bool) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcess(args, @bitCast(pipe_stdio)))); +} + +pub const ProcessIO = enum(c_int) { + processStdioInherited, //The I/O stream is inherited from the application. + processStdioNull, //The I/O stream is ignored. + processStdioApp, //The I/O stream is connected to a new SDL_IOStream that the application can read or write + processStdioRedirect, //The I/O stream is redirected to an existing SDL_IOStream. +}; + +pub inline fn createProcessWithProperties(props: PropertiesID) ?*Process { + return @ptrCast(@alignCast(c.SDL_CreateProcessWithProperties(props))); +} diff --git a/official/release-3.4.8/api/properties.zig b/official/release-3.4.8/api/properties.zig new file mode 100644 index 0000000..5e15c59 --- /dev/null +++ b/official/release-3.4.8/api/properties.zig @@ -0,0 +1,100 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const PropertiesID = u32; + +pub const PropertyType = enum(c_int) { + propertyTypeInvalid, + propertyTypePointer, + propertyTypeString, + propertyTypeNumber, + propertyTypeFloat, + propertyTypeBoolean, +}; + +pub inline fn getGlobalProperties() PropertiesID { + return c.SDL_GetGlobalProperties(); +} + +pub inline fn createProperties() PropertiesID { + return c.SDL_CreateProperties(); +} + +pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool { + return @bitCast(c.SDL_CopyProperties(src, dst)); +} + +pub inline fn lockProperties(props: PropertiesID) bool { + return @bitCast(c.SDL_LockProperties(props)); +} + +pub inline fn unlockProperties(props: PropertiesID) void { + return c.SDL_UnlockProperties(props); +} + +pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback; + +pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata)); +} + +pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool { + return @bitCast(c.SDL_SetPointerProperty(props, name, value)); +} + +pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool { + return @bitCast(c.SDL_SetStringProperty(props, name, value)); +} + +pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool { + return @bitCast(c.SDL_SetNumberProperty(props, name, value)); +} + +pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool { + return @bitCast(c.SDL_SetFloatProperty(props, name, value)); +} + +pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool { + return @bitCast(c.SDL_SetBooleanProperty(props, name, @bitCast(value))); +} + +pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_HasProperty(props, name)); +} + +pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType { + return @fromBackingInt(@intCast(c.SDL_GetPropertyType(props, name))); +} + +pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque { + return c.SDL_GetPointerProperty(props, name, default_value); +} + +pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 { + return c.SDL_GetStringProperty(props, name, default_value); +} + +pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 { + return c.SDL_GetNumberProperty(props, name, default_value); +} + +pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 { + return c.SDL_GetFloatProperty(props, name, default_value); +} + +pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool { + return @bitCast(c.SDL_GetBooleanProperty(props, name, @bitCast(default_value))); +} + +pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool { + return @bitCast(c.SDL_ClearProperty(props, name)); +} + +pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback; + +pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateProperties(props, callback, userdata)); +} + +pub inline fn destroyProperties(props: PropertiesID) void { + return c.SDL_DestroyProperties(props); +} diff --git a/official/release-3.4.8/api/rect.zig b/official/release-3.4.8/api/rect.zig new file mode 100644 index 0000000..04d56b0 --- /dev/null +++ b/official/release-3.4.8/api/rect.zig @@ -0,0 +1,65 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Point = extern struct { + x: c_int, + y: c_int, +}; + +pub const FPoint = extern struct { + x: f32, + y: f32, +}; + +pub const Rect = extern struct { + x: c_int, + y: c_int, + w: c_int, + h: c_int, +}; + +pub const FRect = extern struct { + x: f32, + y: f32, + w: f32, + h: f32, +}; + +pub inline fn hasRectIntersection(A: ?*const Rect, B: ?*const Rect) bool { + return @bitCast(c.SDL_HasRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersection(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectIntersection(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnion(A: ?*const Rect, B: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectUnion(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPoints(points: ?*const Point, count: c_int, clip: ?*const Rect, result: ?*Rect) bool { + return @bitCast(c.SDL_GetRectEnclosingPoints(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersection(rect: ?*const Rect, X1: ?*c_int, Y1: ?*c_int, X2: ?*c_int, Y2: ?*c_int) bool { + return @bitCast(c.SDL_GetRectAndLineIntersection(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} + +pub inline fn hasRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect) bool { + return @bitCast(c.SDL_HasRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)))); +} + +pub inline fn getRectIntersectionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectIntersectionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectUnionFloat(A: ?*const FRect, B: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectUnionFloat(@ptrCast(@alignCast(A)), @ptrCast(@alignCast(B)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectEnclosingPointsFloat(points: ?*const FPoint, count: c_int, clip: ?*const FRect, result: ?*FRect) bool { + return @bitCast(c.SDL_GetRectEnclosingPointsFloat(@ptrCast(@alignCast(points)), count, @ptrCast(@alignCast(clip)), @ptrCast(@alignCast(result)))); +} + +pub inline fn getRectAndLineIntersectionFloat(rect: ?*const FRect, X1: ?*f32, Y1: ?*f32, X2: ?*f32, Y2: ?*f32) bool { + return @bitCast(c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(@alignCast(rect)), X1, Y1, X2, Y2)); +} diff --git a/official/release-3.4.8/api/render.zig b/official/release-3.4.8/api/render.zig new file mode 100644 index 0000000..51b50d0 --- /dev/null +++ b/official/release-3.4.8/api/render.zig @@ -0,0 +1,553 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const rect_api = @import("rect.zig"); +const pixels_api = @import("pixels.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const video_api = @import("video.zig"); +const gpu_api = @import("gpu.zig"); +const blendmode_api = @import("blendmode.zig"); +const events_api = @import("events.zig"); +const joystick_api = @import("joystick.zig"); +const mouse_api = @import("mouse.zig"); +const pen_api = @import("pen.zig"); +const camera_api = @import("camera.zig"); +const keyboard_api = @import("keyboard.zig"); +const power_api = @import("power.zig"); +const touch_api = @import("touch.zig"); +const sensor_api = @import("sensor.zig"); +const audio_api = @import("audio.zig"); +const scancode_api = @import("scancode.zig"); +const keycode_api = @import("keycode.zig"); + +pub const FPoint = rect_api.FPoint; +pub const FColor = pixels_api.FColor; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Window = video_api.Window; +pub const FRect = rect_api.FRect; +pub const GPUTextureSamplerBinding = gpu_api.GPUTextureSamplerBinding; +pub const GPUSampler = gpu_api.GPUSampler; +pub const GPUTexture = gpu_api.GPUTexture; +pub const GPUShader = gpu_api.GPUShader; +pub const WindowFlags = video_api.WindowFlags; +pub const PixelFormat = pixels_api.PixelFormat; +pub const ScaleMode = surface_api.ScaleMode; +pub const GPUDevice = gpu_api.GPUDevice; +pub const BlendMode = blendmode_api.BlendMode; +pub const Event = events_api.Event; +pub const JoyAxisEvent = events_api.JoyAxisEvent; +pub const UserEvent = events_api.UserEvent; +pub const PinchFingerEvent = events_api.PinchFingerEvent; +pub const MouseMotionEvent = events_api.MouseMotionEvent; +pub const CommonEvent = events_api.CommonEvent; +pub const GamepadButtonEvent = events_api.GamepadButtonEvent; +pub const JoyDeviceEvent = events_api.JoyDeviceEvent; +pub const GamepadTouchpadEvent = events_api.GamepadTouchpadEvent; +pub const GamepadSensorEvent = events_api.GamepadSensorEvent; +pub const RenderEvent = events_api.RenderEvent; +pub const ClipboardEvent = events_api.ClipboardEvent; +pub const PenMotionEvent = events_api.PenMotionEvent; +pub const GamepadAxisEvent = events_api.GamepadAxisEvent; +pub const DisplayEvent = events_api.DisplayEvent; +pub const DropEvent = events_api.DropEvent; +pub const CameraDeviceEvent = events_api.CameraDeviceEvent; +pub const KeyboardDeviceEvent = events_api.KeyboardDeviceEvent; +pub const JoyBatteryEvent = events_api.JoyBatteryEvent; +pub const TouchFingerEvent = events_api.TouchFingerEvent; +pub const SensorEvent = events_api.SensorEvent; +pub const TextEditingEvent = events_api.TextEditingEvent; +pub const JoyHatEvent = events_api.JoyHatEvent; +pub const QuitEvent = events_api.QuitEvent; +pub const PenProximityEvent = events_api.PenProximityEvent; +pub const WindowEvent = events_api.WindowEvent; +pub const PenTouchEvent = events_api.PenTouchEvent; +pub const PenButtonEvent = events_api.PenButtonEvent; +pub const GamepadDeviceEvent = events_api.GamepadDeviceEvent; +pub const JoyBallEvent = events_api.JoyBallEvent; +pub const AudioDeviceEvent = events_api.AudioDeviceEvent; +pub const MouseWheelEvent = events_api.MouseWheelEvent; +pub const PenAxisEvent = events_api.PenAxisEvent; +pub const MouseDeviceEvent = events_api.MouseDeviceEvent; +pub const JoyButtonEvent = events_api.JoyButtonEvent; +pub const MouseButtonEvent = events_api.MouseButtonEvent; +pub const KeyboardEvent = events_api.KeyboardEvent; +pub const TextEditingCandidatesEvent = events_api.TextEditingCandidatesEvent; +pub const TextInputEvent = events_api.TextInputEvent; +pub const EventType = events_api.EventType; +pub const JoystickID = joystick_api.JoystickID; +pub const WindowID = video_api.WindowID; +pub const MouseID = mouse_api.MouseID; +pub const MouseButtonFlags = mouse_api.MouseButtonFlags; +pub const PenInputFlags = pen_api.PenInputFlags; +pub const PenID = pen_api.PenID; +pub const DisplayID = video_api.DisplayID; +pub const CameraID = camera_api.CameraID; +pub const KeyboardID = keyboard_api.KeyboardID; +pub const PowerState = power_api.PowerState; +pub const TouchID = touch_api.TouchID; +pub const FingerID = touch_api.FingerID; +pub const SensorID = sensor_api.SensorID; +pub const AudioDeviceID = audio_api.AudioDeviceID; +pub const MouseWheelDirection = mouse_api.MouseWheelDirection; +pub const PenAxis = pen_api.PenAxis; +pub const Scancode = scancode_api.Scancode; +pub const Keymod = keycode_api.Keymod; +pub const Keycode = keycode_api.Keycode; +pub const FlipMode = surface_api.FlipMode; +pub const GPUBuffer = gpu_api.GPUBuffer; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; + +pub const unsupported = struct { + pub const SDL_RenderDebugTextFormat = "varargs function is not representable in Zig"; +}; + +pub const Vertex = extern struct { + position: FPoint, // Vertex position, in SDL_Renderer coordinates + color: FColor, // Vertex color + tex_coord: FPoint, // Normalized texture coordinates, if needed +}; + +pub const TextureAccess = enum(c_int) { + textureaccessStatic, //Changes rarely, not lockable + textureaccessStreaming, //Changes frequently, lockable + textureaccessTarget, //Texture can be used as a render target +}; + +pub const TextureAddressMode = enum(c_int) { + textureAddressInvalid = -1, + textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default + textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range + textureAddressWrap, //The texture is repeated (tiled) +}; + +pub const RendererLogicalPresentation = enum(c_int) { + logicalPresentationDisabled, //There is no logical size in effect + logicalPresentationStretch, //The rendered content is stretched to the output resolution + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds + logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution +}; + +pub const Renderer = opaque { + pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { + return @ptrCast(@alignCast(c.SDL_GetGPURendererDevice(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetRenderWindow(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn getRendererName(renderer: *Renderer) [*c]const u8 { + return c.SDL_GetRendererName(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRendererProperties(renderer: *Renderer) PropertiesID { + return c.SDL_GetRendererProperties(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn getCurrentRenderOutputSize(renderer: *Renderer, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetCurrentRenderOutputSize(@ptrCast(@alignCast(renderer)), w, h)); + } + + pub inline fn createTexture(renderer: *Renderer, format: PixelFormat, access: TextureAccess, w: c_int, h: c_int) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTexture(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(format)), @intCast(@backingInt(access)), w, h))); + } + + pub inline fn createTextureFromSurface(renderer: *Renderer, surface: ?*Surface) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureFromSurface(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(surface))))); + } + + pub inline fn createTextureWithProperties(renderer: *Renderer, props: PropertiesID) ?*Texture { + return @ptrCast(@alignCast(c.SDL_CreateTextureWithProperties(@ptrCast(@alignCast(renderer)), props))); + } + + pub inline fn setRenderTarget(renderer: *Renderer, texture: ?*Texture) bool { + return @bitCast(c.SDL_SetRenderTarget(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)))); + } + + pub inline fn getRenderTarget(renderer: *Renderer) ?*Texture { + return @ptrCast(@alignCast(c.SDL_GetRenderTarget(@ptrCast(@alignCast(renderer))))); + } + + pub inline fn setRenderLogicalPresentation(renderer: *Renderer, w: c_int, h: c_int, mode: RendererLogicalPresentation) bool { + return @bitCast(c.SDL_SetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @intCast(@backingInt(mode)))); + } + + pub inline fn getRenderLogicalPresentation(renderer: *Renderer, w: ?*c_int, h: ?*c_int, mode: ?*RendererLogicalPresentation) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentation(@ptrCast(@alignCast(renderer)), w, h, @ptrCast(@alignCast(mode)))); + } + + pub inline fn getRenderLogicalPresentationRect(renderer: *Renderer, rect: ?*FRect) bool { + return @bitCast(c.SDL_GetRenderLogicalPresentationRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderCoordinatesFromWindow(renderer: *Renderer, window_x: f32, window_y: f32, x: ?*f32, y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesFromWindow(@ptrCast(@alignCast(renderer)), window_x, window_y, x, y)); + } + + pub inline fn renderCoordinatesToWindow(renderer: *Renderer, x: f32, y: f32, window_x: ?*f32, window_y: ?*f32) bool { + return @bitCast(c.SDL_RenderCoordinatesToWindow(@ptrCast(@alignCast(renderer)), x, y, window_x, window_y)); + } + + pub inline fn convertEventToRenderCoordinates(renderer: *Renderer, event: ?*Event) bool { + return @bitCast(c.SDL_ConvertEventToRenderCoordinates(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(event)))); + } + + pub inline fn setRenderViewport(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderViewport(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderViewport(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderViewportSet(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderViewportSet(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderSafeArea(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderSafeArea(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setRenderClipRect(renderer: *Renderer, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getRenderClipRect(renderer: *Renderer, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetRenderClipRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderClipEnabled(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClipEnabled(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn setRenderScale(renderer: *Renderer, scaleX: f32, scaleY: f32) bool { + return @bitCast(c.SDL_SetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn getRenderScale(renderer: *Renderer, scaleX: ?*f32, scaleY: ?*f32) bool { + return @bitCast(c.SDL_GetRenderScale(@ptrCast(@alignCast(renderer)), scaleX, scaleY)); + } + + pub inline fn setRenderDrawColor(renderer: *Renderer, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_SetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderDrawColorFloat(renderer: *Renderer, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_SetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColor(renderer: *Renderer, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_GetRenderDrawColor(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn getRenderDrawColorFloat(renderer: *Renderer, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_GetRenderDrawColorFloat(@ptrCast(@alignCast(renderer)), r, g, b, a)); + } + + pub inline fn setRenderColorScale(renderer: *Renderer, scale: f32) bool { + return @bitCast(c.SDL_SetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn getRenderColorScale(renderer: *Renderer, scale: ?*f32) bool { + return @bitCast(c.SDL_GetRenderColorScale(@ptrCast(@alignCast(renderer)), scale)); + } + + pub inline fn setRenderDrawBlendMode(renderer: *Renderer, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn getRenderDrawBlendMode(renderer: *Renderer, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetRenderDrawBlendMode(@ptrCast(@alignCast(renderer)), blendMode)); + } + + pub inline fn renderClear(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderClear(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn renderPoint(renderer: *Renderer, x: f32, y: f32) bool { + return @bitCast(c.SDL_RenderPoint(@ptrCast(@alignCast(renderer)), x, y)); + } + + pub inline fn renderPoints(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderPoints(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderLine(renderer: *Renderer, x1: f32, y1: f32, x2: f32, y2: f32) bool { + return @bitCast(c.SDL_RenderLine(@ptrCast(@alignCast(renderer)), x1, y1, x2, y2)); + } + + pub inline fn renderLines(renderer: *Renderer, points: ?*const FPoint, count: c_int) bool { + return @bitCast(c.SDL_RenderLines(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(points)), count)); + } + + pub inline fn renderRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderFillRect(renderer: *Renderer, rect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderFillRect(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn renderFillRects(renderer: *Renderer, rects: ?*const FRect, count: c_int) bool { + return @bitCast(c.SDL_RenderFillRects(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rects)), count)); + } + + pub inline fn renderTexture(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTextureRotated(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, dstrect: ?*const FRect, angle: f64, center: ?*const FPoint, flip: FlipMode) bool { + return @bitCast(c.SDL_RenderTextureRotated(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dstrect)), angle, @ptrCast(@alignCast(center)), @bitCast(flip))); + } + + pub inline fn renderTextureAffine(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, origin: ?*const FPoint, right: ?*const FPoint, down: ?*const FPoint) bool { + return @bitCast(c.SDL_RenderTextureAffine(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(origin)), @ptrCast(@alignCast(right)), @ptrCast(@alignCast(down)))); + } + + pub inline fn renderTextureTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTextureTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9Grid(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect) bool { + return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { + return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @ptrCast(@alignCast(dstrect)), tileScale)); + } + + pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometry(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), @ptrCast(@alignCast(vertices)), num_vertices, indices, num_indices)); + } + + pub inline fn renderGeometryRaw(renderer: *Renderer, texture: ?*Texture, xy: *const f32, xy_stride: c_int, color: ?*const FColor, color_stride: c_int, uv: *const f32, uv_stride: c_int, num_vertices: c_int, indices: ?*const anyopaque, num_indices: c_int, size_indices: c_int) bool { + return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(texture)), xy, xy_stride, @ptrCast(@alignCast(color)), color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices)); + } + + pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { + return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(u_mode)), @intCast(@backingInt(v_mode)))); + } + + pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { + return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(u_mode)), @ptrCast(@alignCast(v_mode)))); + } + + pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RenderReadPixels(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(rect))))); + } + + pub inline fn renderPresent(renderer: *Renderer) bool { + return @bitCast(c.SDL_RenderPresent(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn destroyRenderer(renderer: *Renderer) void { + return c.SDL_DestroyRenderer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn flushRenderer(renderer: *Renderer) bool { + return @bitCast(c.SDL_FlushRenderer(@ptrCast(@alignCast(renderer)))); + } + + pub inline fn getRenderMetalLayer(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalLayer(@ptrCast(@alignCast(renderer))); + } + + pub inline fn getRenderMetalCommandEncoder(renderer: *Renderer) ?*anyopaque { + return c.SDL_GetRenderMetalCommandEncoder(@ptrCast(@alignCast(renderer))); + } + + pub inline fn addVulkanRenderSemaphores(renderer: *Renderer, wait_stage_mask: u32, wait_semaphore: i64, signal_semaphore: i64) bool { + return @bitCast(c.SDL_AddVulkanRenderSemaphores(@ptrCast(@alignCast(renderer)), wait_stage_mask, wait_semaphore, signal_semaphore)); + } + + pub inline fn setRenderVSync(renderer: *Renderer, vsync: c_int) bool { + return @bitCast(c.SDL_SetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn getRenderVSync(renderer: *Renderer, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetRenderVSync(@ptrCast(@alignCast(renderer)), vsync)); + } + + pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { + return @bitCast(c.SDL_RenderDebugText(@ptrCast(@alignCast(renderer)), x, y, str)); + } + + pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { + return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @intCast(@backingInt(scale_mode)))); + } + + pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(scale_mode)))); + } + + pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*const GPURenderStateCreateInfo) ?*GPURenderState { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(createinfo))))); + } + + pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { + return @bitCast(c.SDL_SetGPURenderState(@ptrCast(@alignCast(renderer)), @ptrCast(@alignCast(state)))); + } +}; + +pub const Texture = opaque { + pub inline fn getTextureProperties(texture: *Texture) PropertiesID { + return c.SDL_GetTextureProperties(@ptrCast(@alignCast(texture))); + } + + pub inline fn getRendererFromTexture(texture: *Texture) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRendererFromTexture(@ptrCast(@alignCast(texture))))); + } + + pub inline fn getTextureSize(texture: *Texture, w: ?*f32, h: ?*f32) bool { + return @bitCast(c.SDL_GetTextureSize(@ptrCast(@alignCast(texture)), w, h)); + } + + pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetTexturePalette(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getTexturePalette(texture: *Texture) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetTexturePalette(@ptrCast(@alignCast(texture))))); + } + + pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureColorModFloat(texture: *Texture, r: f32, g: f32, b: f32) bool { + return @bitCast(c.SDL_SetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorMod(texture: *Texture, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureColorMod(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn getTextureColorModFloat(texture: *Texture, r: ?*f32, g: ?*f32, b: ?*f32) bool { + return @bitCast(c.SDL_GetTextureColorModFloat(@ptrCast(@alignCast(texture)), r, g, b)); + } + + pub inline fn setTextureAlphaMod(texture: *Texture, alpha: u8) bool { + return @bitCast(c.SDL_SetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureAlphaModFloat(texture: *Texture, alpha: f32) bool { + return @bitCast(c.SDL_SetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaMod(texture: *Texture, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetTextureAlphaMod(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn getTextureAlphaModFloat(texture: *Texture, alpha: ?*f32) bool { + return @bitCast(c.SDL_GetTextureAlphaModFloat(@ptrCast(@alignCast(texture)), alpha)); + } + + pub inline fn setTextureBlendMode(texture: *Texture, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn getTextureBlendMode(texture: *Texture, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetTextureBlendMode(@ptrCast(@alignCast(texture)), blendMode)); + } + + pub inline fn setTextureScaleMode(texture: *Texture, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_SetTextureScaleMode(@ptrCast(@alignCast(texture)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn getTextureScaleMode(texture: *Texture, scaleMode: ?*ScaleMode) bool { + return @bitCast(c.SDL_GetTextureScaleMode(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(scaleMode)))); + } + + pub inline fn updateTexture(texture: *Texture, rect: ?*const Rect, pixels: ?*const anyopaque, pitch: c_int) bool { + return @bitCast(c.SDL_UpdateTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn updateYUVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, Uplane: [*c]const u8, Upitch: c_int, Vplane: [*c]const u8, Vpitch: c_int) bool { + return @bitCast(c.SDL_UpdateYUVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch)); + } + + pub inline fn updateNVTexture(texture: *Texture, rect: ?*const Rect, Yplane: [*c]const u8, Ypitch: c_int, UVplane: [*c]const u8, UVpitch: c_int) bool { + return @bitCast(c.SDL_UpdateNVTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), Yplane, Ypitch, UVplane, UVpitch)); + } + + pub inline fn lockTexture(texture: *Texture, rect: ?*const Rect, pixels: [*c]?*anyopaque, pitch: ?*c_int) bool { + return @bitCast(c.SDL_LockTexture(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), pixels, pitch)); + } + + pub inline fn lockTextureToSurface(texture: *Texture, rect: ?*const Rect, surface: [*c]?*Surface) bool { + return @bitCast(c.SDL_LockTextureToSurface(@ptrCast(@alignCast(texture)), @ptrCast(@alignCast(rect)), @ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockTexture(texture: *Texture) void { + return c.SDL_UnlockTexture(@ptrCast(@alignCast(texture))); + } + + pub inline fn destroyTexture(texture: *Texture) void { + return c.SDL_DestroyTexture(@ptrCast(@alignCast(texture))); + } +}; + +pub inline fn getNumRenderDrivers() c_int { + return c.SDL_GetNumRenderDrivers(); +} + +pub inline fn getRenderDriver(index: c_int) [*c]const u8 { + return c.SDL_GetRenderDriver(index); +} + +pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: c_int, window_flags: WindowFlags, window: [*c]?*Window, renderer: [*c]?*Renderer) bool { + return @bitCast(c.SDL_CreateWindowAndRenderer(title, width, height, @bitCast(window_flags), @ptrCast(@alignCast(window)), @ptrCast(@alignCast(renderer)))); +} + +pub inline fn createRenderer(window: ?*Window, name: [*c]const u8) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRenderer(@ptrCast(@alignCast(window)), name))); +} + +pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateRendererWithProperties(props))); +} + +pub inline fn createGPURenderer(device: ?*GPUDevice, window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateGPURenderer(@ptrCast(@alignCast(device)), @ptrCast(@alignCast(window))))); +} + +pub inline fn createSoftwareRenderer(surface: ?*Surface) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_CreateSoftwareRenderer(@ptrCast(@alignCast(surface))))); +} + +pub inline fn getRenderer(window: ?*Window) ?*Renderer { + return @ptrCast(@alignCast(c.SDL_GetRenderer(@ptrCast(@alignCast(window))))); +} + +pub const GPURenderStateCreateInfo = extern struct { + fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active + num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active + sampler_bindings: [*c]const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active + num_storage_textures: i32, // The number of storage textures to bind when this render state is active + storage_textures: [*c]const ?*GPUTexture, // Storage textures to bind when this render state is active + num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active + storage_buffers: [*c]const ?*GPUBuffer, // Storage buffers to bind when this render state is active + props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. +}; + +pub const GPURenderState = opaque { + pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { + return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(@alignCast(gpurenderstate)), slot_index, data, length)); + } + + pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { + return c.SDL_DestroyGPURenderState(@ptrCast(@alignCast(gpurenderstate))); + } +}; diff --git a/official/release-3.4.8/api/scancode.zig b/official/release-3.4.8/api/scancode.zig new file mode 100644 index 0000000..02f5b44 --- /dev/null +++ b/official/release-3.4.8/api/scancode.zig @@ -0,0 +1,253 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const Scancode = enum(c_int) { + scancodeUnknown = 0, + scancodeA = 4, + scancodeB = 5, + scancodeC = 6, + scancodeD = 7, + scancodeE = 8, + scancodeF = 9, + scancodeG = 10, + scancodeH = 11, + scancodeI = 12, + scancodeJ = 13, + scancodeK = 14, + scancodeL = 15, + scancodeM = 16, + scancodeN = 17, + scancodeO = 18, + scancodeP = 19, + scancodeQ = 20, + scancodeR = 21, + scancodeS = 22, + scancodeT = 23, + scancodeU = 24, + scancodeV = 25, + scancodeW = 26, + scancodeX = 27, + scancodeY = 28, + scancodeZ = 29, + scancode1 = 30, + scancode2 = 31, + scancode3 = 32, + scancode4 = 33, + scancode5 = 34, + scancode6 = 35, + scancode7 = 36, + scancode8 = 37, + scancode9 = 38, + scancode0 = 39, + scancodeReturn = 40, + scancodeEscape = 41, + scancodeBackspace = 42, + scancodeTab = 43, + scancodeSpace = 44, + scancodeMinus = 45, + scancodeEquals = 46, + scancodeLeftbracket = 47, + scancodeRightbracket = 48, + scancodeBackslash = 49, //Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. + scancodeNonushash = 50, //ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. + scancodeSemicolon = 51, + scancodeApostrophe = 52, + scancodeGrave = 53, //Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. + scancodeComma = 54, + scancodePeriod = 55, + scancodeSlash = 56, + scancodeCapslock = 57, + scancodeF1 = 58, + scancodeF2 = 59, + scancodeF3 = 60, + scancodeF4 = 61, + scancodeF5 = 62, + scancodeF6 = 63, + scancodeF7 = 64, + scancodeF8 = 65, + scancodeF9 = 66, + scancodeF10 = 67, + scancodeF11 = 68, + scancodeF12 = 69, + scancodePrintscreen = 70, + scancodeScrolllock = 71, + scancodePause = 72, + scancodeInsert = 73, //insert on PC, help on some Mac keyboards (but does send code 73, not 117) + scancodeHome = 74, + scancodePageup = 75, + scancodeDelete = 76, + scancodeEnd = 77, + scancodePagedown = 78, + scancodeRight = 79, + scancodeLeft = 80, + scancodeDown = 81, + scancodeUp = 82, + scancodeNumlockclear = 83, //num lock on PC, clear on Mac keyboards + scancodeKpDivide = 84, + scancodeKpMultiply = 85, + scancodeKpMinus = 86, + scancodeKpPlus = 87, + scancodeKpEnter = 88, + scancodeKp1 = 89, + scancodeKp2 = 90, + scancodeKp3 = 91, + scancodeKp4 = 92, + scancodeKp5 = 93, + scancodeKp6 = 94, + scancodeKp7 = 95, + scancodeKp8 = 96, + scancodeKp9 = 97, + scancodeKp0 = 98, + scancodeKpPeriod = 99, + scancodeNonusbackslash = 100, //This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. + scancodeApplication = 101, //windows contextual menu, compose + scancodePower = 102, //The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. + scancodeKpEquals = 103, + scancodeF13 = 104, + scancodeF14 = 105, + scancodeF15 = 106, + scancodeF16 = 107, + scancodeF17 = 108, + scancodeF18 = 109, + scancodeF19 = 110, + scancodeF20 = 111, + scancodeF21 = 112, + scancodeF22 = 113, + scancodeF23 = 114, + scancodeF24 = 115, + scancodeExecute = 116, + scancodeHelp = 117, //AL Integrated Help Center + scancodeMenu = 118, //Menu (show menu) + scancodeSelect = 119, + scancodeStop = 120, //AC Stop + scancodeAgain = 121, //AC Redo/Repeat + scancodeUndo = 122, //AC Undo + scancodeCut = 123, //AC Cut + scancodeCopy = 124, //AC Copy + scancodePaste = 125, //AC Paste + scancodeFind = 126, //AC Find + scancodeMute = 127, + scancodeVolumeup = 128, + scancodeVolumedown = 129, + scancodeKpComma = 133, + scancodeKpEqualsas400 = 134, + scancodeInternational1 = 135, //used on Asian keyboards, see footnotes in USB doc + scancodeInternational2 = 136, + scancodeInternational3 = 137, //Yen + scancodeInternational4 = 138, + scancodeInternational5 = 139, + scancodeInternational6 = 140, + scancodeInternational7 = 141, + scancodeInternational8 = 142, + scancodeInternational9 = 143, + scancodeLang1 = 144, //Hangul/English toggle + scancodeLang2 = 145, //Hanja conversion + scancodeLang3 = 146, //Katakana + scancodeLang4 = 147, //Hiragana + scancodeLang5 = 148, //Zenkaku/Hankaku + scancodeLang6 = 149, //reserved + scancodeLang7 = 150, //reserved + scancodeLang8 = 151, //reserved + scancodeLang9 = 152, //reserved + scancodeAlterase = 153, //Erase-Eaze + scancodeSysreq = 154, + scancodeCancel = 155, //AC Cancel + scancodeClear = 156, + scancodePrior = 157, + scancodeReturn2 = 158, + scancodeSeparator = 159, + scancodeOut = 160, + scancodeOper = 161, + scancodeClearagain = 162, + scancodeCrsel = 163, + scancodeExsel = 164, + scancodeKp00 = 176, + scancodeKp000 = 177, + scancodeThousandsseparator = 178, + scancodeDecimalseparator = 179, + scancodeCurrencyunit = 180, + scancodeCurrencysubunit = 181, + scancodeKpLeftparen = 182, + scancodeKpRightparen = 183, + scancodeKpLeftbrace = 184, + scancodeKpRightbrace = 185, + scancodeKpTab = 186, + scancodeKpBackspace = 187, + scancodeKpA = 188, + scancodeKpB = 189, + scancodeKpC = 190, + scancodeKpD = 191, + scancodeKpE = 192, + scancodeKpF = 193, + scancodeKpXor = 194, + scancodeKpPower = 195, + scancodeKpPercent = 196, + scancodeKpLess = 197, + scancodeKpGreater = 198, + scancodeKpAmpersand = 199, + scancodeKpDblampersand = 200, + scancodeKpVerticalbar = 201, + scancodeKpDblverticalbar = 202, + scancodeKpColon = 203, + scancodeKpHash = 204, + scancodeKpSpace = 205, + scancodeKpAt = 206, + scancodeKpExclam = 207, + scancodeKpMemstore = 208, + scancodeKpMemrecall = 209, + scancodeKpMemclear = 210, + scancodeKpMemadd = 211, + scancodeKpMemsubtract = 212, + scancodeKpMemmultiply = 213, + scancodeKpMemdivide = 214, + scancodeKpPlusminus = 215, + scancodeKpClear = 216, + scancodeKpClearentry = 217, + scancodeKpBinary = 218, + scancodeKpOctal = 219, + scancodeKpDecimal = 220, + scancodeKpHexadecimal = 221, + scancodeLctrl = 224, + scancodeLshift = 225, + scancodeLalt = 226, //alt, option + scancodeLgui = 227, //windows, command (apple), meta + scancodeRctrl = 228, + scancodeRshift = 229, + scancodeRalt = 230, //alt gr, option + scancodeRgui = 231, //windows, command (apple), meta + scancodeMode = 257, //I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here + scancodeSleep = 258, //Sleep + scancodeWake = 259, //Wake + scancodeChannelIncrement = 260, //Channel Increment + scancodeChannelDecrement = 261, //Channel Decrement + scancodeMediaPlay = 262, //Play + scancodeMediaPause = 263, //Pause + scancodeMediaRecord = 264, //Record + scancodeMediaFastForward = 265, //Fast Forward + scancodeMediaRewind = 266, //Rewind + scancodeMediaNextTrack = 267, //Next Track + scancodeMediaPreviousTrack = 268, //Previous Track + scancodeMediaStop = 269, //Stop + scancodeMediaEject = 270, //Eject + scancodeMediaPlayPause = 271, //Play / Pause + scancodeMediaSelect = 272, + scancodeAcNew = 273, //AC New + scancodeAcOpen = 274, //AC Open + scancodeAcClose = 275, //AC Close + scancodeAcExit = 276, //AC Exit + scancodeAcSave = 277, //AC Save + scancodeAcPrint = 278, //AC Print + scancodeAcProperties = 279, //AC Properties + scancodeAcSearch = 280, //AC Search + scancodeAcHome = 281, //AC Home + scancodeAcBack = 282, //AC Back + scancodeAcForward = 283, //AC Forward + scancodeAcStop = 284, //AC Stop + scancodeAcRefresh = 285, //AC Refresh + scancodeAcBookmarks = 286, //AC Bookmarks + scancodeSoftleft = 287, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. + scancodeSoftright = 288, //Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. + scancodeCall = 289, //Used for accepting phone calls. + scancodeEndcall = 290, //Used for rejecting phone calls. + scancodeReserved = 400, //400-500 reserved for dynamic keycodes + scancodeCount = 512, //not a key, just marks the number of scancodes for array bounds +}; diff --git a/official/release-3.4.8/api/sensor.zig b/official/release-3.4.8/api/sensor.zig new file mode 100644 index 0000000..f471675 --- /dev/null +++ b/official/release-3.4.8/api/sensor.zig @@ -0,0 +1,77 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const properties_api = @import("properties.zig"); + +pub const PropertiesID = properties_api.PropertiesID; + +pub const Sensor = opaque { + pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID { + return c.SDL_GetSensorProperties(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 { + return c.SDL_GetSensorName(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorType(sensor: *Sensor) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorType(@ptrCast(@alignCast(sensor))))); + } + + pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int { + return c.SDL_GetSensorNonPortableType(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorID(sensor: *Sensor) SensorID { + return c.SDL_GetSensorID(@ptrCast(@alignCast(sensor))); + } + + pub inline fn getSensorData(sensor: *Sensor, data: ?*f32, num_values: c_int) bool { + return @bitCast(c.SDL_GetSensorData(@ptrCast(@alignCast(sensor)), data, num_values)); + } + + pub inline fn closeSensor(sensor: *Sensor) void { + return c.SDL_CloseSensor(@ptrCast(@alignCast(sensor))); + } +}; + +pub const SensorID = u32; + +pub const SensorType = enum(c_int) { + sensorInvalid = -1, //Returned for an invalid sensor + sensorUnknown, //Unknown sensor type + sensorAccel, //Accelerometer + sensorGyro, //Gyroscope + sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk + sensorGyroL, //Gyroscope for left Joy-Con controller + sensorAccelR, //Accelerometer for right Joy-Con controller + sensorGyroR, //Gyroscope for right Joy-Con controller + sensorCount, +}; + +pub inline fn getSensors(count: ?*c_int) ?*SensorID { + return c.SDL_GetSensors(count); +} + +pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 { + return c.SDL_GetSensorNameForID(instance_id); +} + +pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType { + return @fromBackingInt(@intCast(c.SDL_GetSensorTypeForID(instance_id))); +} + +pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int { + return c.SDL_GetSensorNonPortableTypeForID(instance_id); +} + +pub inline fn openSensor(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_OpenSensor(instance_id))); +} + +pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor { + return @ptrCast(@alignCast(c.SDL_GetSensorFromID(instance_id))); +} + +pub inline fn updateSensors() void { + return c.SDL_UpdateSensors(); +} diff --git a/official/release-3.4.8/api/stdinc.zig b/official/release-3.4.8/api/stdinc.zig new file mode 100644 index 0000000..89d8778 --- /dev/null +++ b/official/release-3.4.8/api/stdinc.zig @@ -0,0 +1,3 @@ +pub const c = @import("c.zig").c; +pub const Time = i64; +pub const FunctionPointer = c.SDL_FunctionPointer; diff --git a/official/release-3.4.8/api/storage.zig b/official/release-3.4.8/api/storage.zig new file mode 100644 index 0000000..702db88 --- /dev/null +++ b/official/release-3.4.8/api/storage.zig @@ -0,0 +1,97 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const filesystem_api = @import("filesystem.zig"); +const stdinc_api = @import("stdinc.zig"); +const properties_api = @import("properties.zig"); + +pub const PathInfo = filesystem_api.PathInfo; +pub const PathType = filesystem_api.PathType; +pub const Time = stdinc_api.Time; +pub const GlobFlags = filesystem_api.GlobFlags; +pub const EnumerateDirectoryCallback = filesystem_api.EnumerateDirectoryCallback; +pub const PropertiesID = properties_api.PropertiesID; + +pub const StorageInterface = extern struct { + version: u32, + close: ?*const fn (?*anyopaque) callconv(.c) bool, + ready: ?*const fn (?*anyopaque) callconv(.c) bool, + enumerate: ?*const fn (?*anyopaque, [*c]const u8, EnumerateDirectoryCallback, ?*anyopaque) callconv(.c) bool, + info: ?*const fn (?*anyopaque, [*c]const u8, ?*PathInfo) callconv(.c) bool, + read_file: ?*const fn (?*anyopaque, [*c]const u8, ?*anyopaque, u64) callconv(.c) bool, + write_file: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque, u64) callconv(.c) bool, + mkdir: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + remove: ?*const fn (?*anyopaque, [*c]const u8) callconv(.c) bool, + rename: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + copy: ?*const fn (?*anyopaque, [*c]const u8, [*c]const u8) callconv(.c) bool, + space_remaining: ?*const fn (?*anyopaque) callconv(.c) u64, +}; + +pub const Storage = opaque { + pub inline fn closeStorage(storage: *Storage) bool { + return @bitCast(c.SDL_CloseStorage(@ptrCast(@alignCast(storage)))); + } + + pub inline fn storageReady(storage: *Storage) bool { + return @bitCast(c.SDL_StorageReady(@ptrCast(@alignCast(storage)))); + } + + pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: ?*u64) bool { + return @bitCast(c.SDL_GetStorageFileSize(@ptrCast(@alignCast(storage)), path, length)); + } + + pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool { + return @bitCast(c.SDL_ReadStorageFile(@ptrCast(@alignCast(storage)), path, destination, length)); + } + + pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool { + return @bitCast(c.SDL_WriteStorageFile(@ptrCast(@alignCast(storage)), path, source, length)); + } + + pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_CreateStorageDirectory(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_EnumerateStorageDirectory(@ptrCast(@alignCast(storage)), path, callback, userdata)); + } + + pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool { + return @bitCast(c.SDL_RemoveStoragePath(@ptrCast(@alignCast(storage)), path)); + } + + pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_RenameStoragePath(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool { + return @bitCast(c.SDL_CopyStorageFile(@ptrCast(@alignCast(storage)), oldpath, newpath)); + } + + pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool { + return @bitCast(c.SDL_GetStoragePathInfo(@ptrCast(@alignCast(storage)), path, @ptrCast(@alignCast(info)))); + } + + pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 { + return c.SDL_GetStorageSpaceRemaining(@ptrCast(@alignCast(storage))); + } + + pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: ?*c_int) [*c][*c]u8 { + return c.SDL_GlobStorageDirectory(@ptrCast(@alignCast(storage)), path, pattern, @bitCast(flags), count); + } +}; + +pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenTitleStorage(override, props))); +} + +pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenUserStorage(org, app, props))); +} + +pub inline fn openFileStorage(path: [*c]const u8) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenFileStorage(path))); +} + +pub inline fn openStorage(iface: ?*const StorageInterface, userdata: ?*anyopaque) ?*Storage { + return @ptrCast(@alignCast(c.SDL_OpenStorage(@ptrCast(@alignCast(iface)), userdata))); +} diff --git a/official/release-3.4.8/api/surface.zig b/official/release-3.4.8/api/surface.zig new file mode 100644 index 0000000..02e7681 --- /dev/null +++ b/official/release-3.4.8/api/surface.zig @@ -0,0 +1,305 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const blendmode_api = @import("blendmode.zig"); +const iostream_api = @import("iostream.zig"); +const rect_api = @import("rect.zig"); +const properties_api = @import("properties.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const BlendMode = blendmode_api.BlendMode; +pub const IOStream = iostream_api.IOStream; +pub const Rect = rect_api.Rect; +pub const Palette = pixels_api.Palette; +pub const Color = pixels_api.Color; +pub const Colorspace = pixels_api.Colorspace; +pub const PropertiesID = properties_api.PropertiesID; + +pub const SurfaceFlags = packed struct(u32) { + surfacePreallocated: bool = false, // Surface uses preallocated pixel memory + surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels + surfaceLocked: bool = false, // Surface is currently locked + surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc() + pad0: u27 = 0, + rsvd: bool = false, + + pub const None = SurfaceFlags{}; +}; + +pub const ScaleMode = enum(c_int) { + scalemodeInvalid = -1, + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering + scalemodePixelart, //nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 +}; + +pub const FlipMode = packed struct(u32) { + flipHorizontal: bool = false, // flip horizontally + flipVertical: bool = false, // flip vertically + pad0: u29 = 0, + rsvd: bool = false, + + pub const None = FlipMode{}; +}; + +pub const Surface = opaque { + pub inline fn destroySurface(surface: *Surface) void { + return c.SDL_DestroySurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID { + return c.SDL_GetSurfaceProperties(@ptrCast(@alignCast(surface))); + } + + pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool { + return @bitCast(c.SDL_SetSurfaceColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(colorspace)))); + } + + pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace { + return @fromBackingInt(@intCast(c.SDL_GetSurfaceColorspace(@ptrCast(@alignCast(surface))))); + } + + pub inline fn createSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_CreateSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool { + return @bitCast(c.SDL_SetSurfacePalette(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(palette)))); + } + + pub inline fn getSurfacePalette(surface: *Surface) ?*Palette { + return @ptrCast(@alignCast(c.SDL_GetSurfacePalette(@ptrCast(@alignCast(surface))))); + } + + pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool { + return @bitCast(c.SDL_AddSurfaceAlternateImage(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(image)))); + } + + pub inline fn surfaceHasAlternateImages(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasAlternateImages(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceImages(surface: *Surface, count: ?*c_int) [*c]?*Surface { + return @ptrCast(@alignCast(c.SDL_GetSurfaceImages(@ptrCast(@alignCast(surface)), count))); + } + + pub inline fn removeSurfaceAlternateImages(surface: *Surface) void { + return c.SDL_RemoveSurfaceAlternateImages(@ptrCast(@alignCast(surface))); + } + + pub inline fn lockSurface(surface: *Surface) bool { + return @bitCast(c.SDL_LockSurface(@ptrCast(@alignCast(surface)))); + } + + pub inline fn unlockSurface(surface: *Surface) void { + return c.SDL_UnlockSurface(@ptrCast(@alignCast(surface))); + } + + pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SaveBMP_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SaveBMP(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { + return @bitCast(c.SDL_SavePNG_IO(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(dst)), @bitCast(closeio))); + } + + pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { + return @bitCast(c.SDL_SavePNG(@ptrCast(@alignCast(surface)), file)); + } + + pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { + return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(@alignCast(surface)), @bitCast(enabled))); + } + + pub inline fn surfaceHasRLE(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasRLE(@ptrCast(@alignCast(surface)))); + } + + pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool { + return @bitCast(c.SDL_SetSurfaceColorKey(@ptrCast(@alignCast(surface)), @bitCast(enabled), key)); + } + + pub inline fn surfaceHasColorKey(surface: *Surface) bool { + return @bitCast(c.SDL_SurfaceHasColorKey(@ptrCast(@alignCast(surface)))); + } + + pub inline fn getSurfaceColorKey(surface: *Surface, key: ?*u32) bool { + return @bitCast(c.SDL_GetSurfaceColorKey(@ptrCast(@alignCast(surface)), key)); + } + + pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool { + return @bitCast(c.SDL_SetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceColorMod(@ptrCast(@alignCast(surface)), r, g, b)); + } + + pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool { + return @bitCast(c.SDL_SetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool { + return @bitCast(c.SDL_GetSurfaceAlphaMod(@ptrCast(@alignCast(surface)), alpha)); + } + + pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool { + return @bitCast(c.SDL_SetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool { + return @bitCast(c.SDL_GetSurfaceBlendMode(@ptrCast(@alignCast(surface)), blendMode)); + } + + pub inline fn setSurfaceClipRect(surface: *Surface, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetSurfaceClipRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool { + return @bitCast(c.SDL_FlipSurface(@ptrCast(@alignCast(surface)), @bitCast(flip))); + } + + pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { + return @ptrCast(@alignCast(c.SDL_RotateSurface(@ptrCast(@alignCast(surface)), angle))); + } + + pub inline fn duplicateSurface(surface: *Surface) ?*Surface { + return @ptrCast(@alignCast(c.SDL_DuplicateSurface(@ptrCast(@alignCast(surface))))); + } + + pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ScaleSurface(@ptrCast(@alignCast(surface)), width, height, @intCast(@backingInt(scaleMode))))); + } + + pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurface(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format))))); + } + + pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface { + return @ptrCast(@alignCast(c.SDL_ConvertSurfaceAndColorspace(@ptrCast(@alignCast(surface)), @intCast(@backingInt(format)), @ptrCast(@alignCast(palette)), @intCast(@backingInt(colorspace)), props))); + } + + pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool { + return @bitCast(c.SDL_PremultiplySurfaceAlpha(@ptrCast(@alignCast(surface)), @bitCast(linear))); + } + + pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_ClearSurface(@ptrCast(@alignCast(surface)), r, g, b, a)); + } + + pub inline fn fillSurfaceRect(surface: *Surface, rect: ?*const Rect, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRect(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rect)), color)); + } + + pub inline fn fillSurfaceRects(surface: *Surface, rects: ?*const Rect, count: c_int, color: u32) bool { + return @bitCast(c.SDL_FillSurfaceRects(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(rects)), count, color)); + } + + pub inline fn blitSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceUnchecked(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { + return @bitCast(c.SDL_StretchSurface(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)), @intCast(@backingInt(scaleMode)))); + } + + pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: ?*const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurfaceTiledWithScale(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn blitSurface9Grid(surface: *Surface, srcrect: ?*const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: ?*const Rect) bool { + return @bitCast(c.SDL_BlitSurface9Grid(@ptrCast(@alignCast(surface)), @ptrCast(@alignCast(srcrect)), left_width, right_width, top_height, bottom_height, scale, @intCast(@backingInt(scaleMode)), @ptrCast(@alignCast(dst)), @ptrCast(@alignCast(dstrect)))); + } + + pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 { + return c.SDL_MapSurfaceRGB(@ptrCast(@alignCast(surface)), r, g, b); + } + + pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 { + return c.SDL_MapSurfaceRGBA(@ptrCast(@alignCast(surface)), r, g, b, a); + } + + pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool { + return @bitCast(c.SDL_ReadSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: ?*f32, g: ?*f32, b: ?*f32, a: ?*f32) bool { + return @bitCast(c.SDL_ReadSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool { + return @bitCast(c.SDL_WriteSurfacePixel(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } + + pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool { + return @bitCast(c.SDL_WriteSurfacePixelFloat(@ptrCast(@alignCast(surface)), x, y, r, g, b, a)); + } +}; + +pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurface(width, height, @intCast(@backingInt(format))))); +} + +pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface { + return @ptrCast(@alignCast(c.SDL_CreateSurfaceFrom(width, height, @intCast(@backingInt(format)), pixels, pitch))); +} + +pub inline fn loadSurface_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadSurface(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadSurface(file))); +} + +pub inline fn loadBMP_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadBMP(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadBMP(file))); +} + +pub inline fn loadPNG_IO(src: ?*IOStream, closeio: bool) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG_IO(@ptrCast(@alignCast(src)), @bitCast(closeio)))); +} + +pub inline fn loadPNG(file: [*c]const u8) ?*Surface { + return @ptrCast(@alignCast(c.SDL_LoadPNG(file))); +} + +pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixels(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch)); +} + +pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool { + return @bitCast(c.SDL_ConvertPixelsAndColorspace(width, height, @intCast(@backingInt(src_format)), @intCast(@backingInt(src_colorspace)), src_properties, src, src_pitch, @intCast(@backingInt(dst_format)), @intCast(@backingInt(dst_colorspace)), dst_properties, dst, dst_pitch)); +} + +pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool { + return @bitCast(c.SDL_PremultiplyAlpha(width, height, @intCast(@backingInt(src_format)), src, src_pitch, @intCast(@backingInt(dst_format)), dst, dst_pitch, @bitCast(linear))); +} diff --git a/official/release-3.4.8/api/system.zig b/official/release-3.4.8/api/system.zig new file mode 100644 index 0000000..2972144 --- /dev/null +++ b/official/release-3.4.8/api/system.zig @@ -0,0 +1,160 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const video_api = @import("video.zig"); + +pub const DisplayID = video_api.DisplayID; +pub const Window = video_api.Window; + +pub const MSG = opaque {}; + +pub const WindowsMessageHook = c.SDL_WindowsMessageHook; + +pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void { + return c.SDL_SetWindowsMessageHook(callback, userdata); +} + +pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int { + return c.SDL_GetDirect3D9AdapterIndex(displayID); +} + +pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: ?*c_int, outputIndex: ?*c_int) bool { + return @bitCast(c.SDL_GetDXGIOutputInfo(displayID, adapterIndex, outputIndex)); +} + +pub const X11EventHook = c.SDL_X11EventHook; + +pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void { + return c.SDL_SetX11EventHook(callback, userdata); +} + +pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriority(threadID, priority)); +} + +pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool { + return @bitCast(c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy)); +} + +pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback; + +pub inline fn setiOSAnimationCallback(window: ?*Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool { + return @bitCast(c.SDL_SetiOSAnimationCallback(@ptrCast(@alignCast(window)), interval, callback, callbackParam)); +} + +pub inline fn setiOSEventPump(enabled: bool) void { + return c.SDL_SetiOSEventPump(@bitCast(enabled)); +} + +pub inline fn getAndroidJNIEnv() ?*anyopaque { + return c.SDL_GetAndroidJNIEnv(); +} + +pub inline fn getAndroidActivity() ?*anyopaque { + return c.SDL_GetAndroidActivity(); +} + +pub inline fn getAndroidSDKVersion() c_int { + return c.SDL_GetAndroidSDKVersion(); +} + +pub inline fn isChromebook() bool { + return @bitCast(c.SDL_IsChromebook()); +} + +pub inline fn isDeXMode() bool { + return @bitCast(c.SDL_IsDeXMode()); +} + +pub inline fn sendAndroidBackButton() void { + return c.SDL_SendAndroidBackButton(); +} + +pub inline fn getAndroidInternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidInternalStoragePath(); +} + +pub inline fn getAndroidExternalStorageState() u32 { + return c.SDL_GetAndroidExternalStorageState(); +} + +pub inline fn getAndroidExternalStoragePath() [*c]const u8 { + return c.SDL_GetAndroidExternalStoragePath(); +} + +pub inline fn getAndroidCachePath() [*c]const u8 { + return c.SDL_GetAndroidCachePath(); +} + +pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback; + +pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool { + return @bitCast(c.SDL_RequestAndroidPermission(permission, cb, userdata)); +} + +pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool { + return @bitCast(c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset)); +} + +pub inline fn sendAndroidMessage(command: u32, param: c_int) bool { + return @bitCast(c.SDL_SendAndroidMessage(command, param)); +} + +pub inline fn isTablet() bool { + return @bitCast(c.SDL_IsTablet()); +} + +pub inline fn isTV() bool { + return @bitCast(c.SDL_IsTV()); +} + +pub const Sandbox = enum(c_int) { + sandboxNone = 0, + sandboxUnknownContainer, + sandboxFlatpak, + sandboxSnap, + sandboxMacos, +}; + +pub inline fn getSandbox() Sandbox { + return @fromBackingInt(@intCast(c.SDL_GetSandbox())); +} + +pub inline fn onApplicationWillTerminate() void { + return c.SDL_OnApplicationWillTerminate(); +} + +pub inline fn onApplicationDidReceiveMemoryWarning() void { + return c.SDL_OnApplicationDidReceiveMemoryWarning(); +} + +pub inline fn onApplicationWillEnterBackground() void { + return c.SDL_OnApplicationWillEnterBackground(); +} + +pub inline fn onApplicationDidEnterBackground() void { + return c.SDL_OnApplicationDidEnterBackground(); +} + +pub inline fn onApplicationWillEnterForeground() void { + return c.SDL_OnApplicationWillEnterForeground(); +} + +pub inline fn onApplicationDidEnterForeground() void { + return c.SDL_OnApplicationDidEnterForeground(); +} + +pub inline fn onApplicationDidChangeStatusBarOrientation() void { + return c.SDL_OnApplicationDidChangeStatusBarOrientation(); +} + +pub const XTaskQueueHandle = ?*anyopaque; + +pub const XUserHandle = ?*anyopaque; + +pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool { + return @bitCast(c.SDL_GetGDKTaskQueue(@ptrCast(@alignCast(outTaskQueue)))); +} + +pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool { + return @bitCast(c.SDL_GetGDKDefaultUser(@ptrCast(@alignCast(outUserHandle)))); +} diff --git a/official/release-3.4.8/api/time.zig b/official/release-3.4.8/api/time.zig new file mode 100644 index 0000000..4eff0c3 --- /dev/null +++ b/official/release-3.4.8/api/time.zig @@ -0,0 +1,64 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const stdinc_api = @import("stdinc.zig"); + +pub const Time = stdinc_api.Time; + +pub const DateTime = extern struct { + year: c_int, // Year + month: c_int, // Month [01-12] + day: c_int, // Day of the month [01-31] + hour: c_int, // Hour [0-23] + minute: c_int, // Minute [0-59] + second: c_int, // Seconds [0-60] + nanosecond: c_int, // Nanoseconds [0-999999999] + day_of_week: c_int, // Day of the week [0-6] (0 being Sunday) + utc_offset: c_int, // Seconds east of UTC +}; + +pub const DateFormat = enum(c_int) { + dateFormatYyyymmdd = 0, //Year/Month/Day + dateFormatDdmmyyyy = 1, //Day/Month/Year + dateFormatMmddyyyy = 2, //Month/Day/Year +}; + +pub const TimeFormat = enum(c_int) { + timeFormat24hr = 0, //24 hour time + timeFormat12hr = 1, //12 hour time +}; + +pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool { + return @bitCast(c.SDL_GetDateTimeLocalePreferences(@ptrCast(@alignCast(dateFormat)), @ptrCast(@alignCast(timeFormat)))); +} + +pub inline fn getCurrentTime(ticks: ?*Time) bool { + return @bitCast(c.SDL_GetCurrentTime(ticks)); +} + +pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool { + return @bitCast(c.SDL_TimeToDateTime(ticks, @ptrCast(@alignCast(dt)), @bitCast(localTime))); +} + +pub inline fn dateTimeToTime(dt: ?*const DateTime, ticks: ?*Time) bool { + return @bitCast(c.SDL_DateTimeToTime(@ptrCast(@alignCast(dt)), ticks)); +} + +pub inline fn timeToWindows(ticks: Time, dwLowDateTime: ?*u32, dwHighDateTime: ?*u32) void { + return c.SDL_TimeToWindows(ticks, dwLowDateTime, dwHighDateTime); +} + +pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time { + return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime); +} + +pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int { + return c.SDL_GetDaysInMonth(year, month); +} + +pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfYear(year, month, day); +} + +pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int { + return c.SDL_GetDayOfWeek(year, month, day); +} diff --git a/official/release-3.4.8/api/timer.zig b/official/release-3.4.8/api/timer.zig new file mode 100644 index 0000000..72b8518 --- /dev/null +++ b/official/release-3.4.8/api/timer.zig @@ -0,0 +1,47 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getTicks() u64 { + return c.SDL_GetTicks(); +} + +pub inline fn getTicksNS() u64 { + return c.SDL_GetTicksNS(); +} + +pub inline fn getPerformanceCounter() u64 { + return c.SDL_GetPerformanceCounter(); +} + +pub inline fn getPerformanceFrequency() u64 { + return c.SDL_GetPerformanceFrequency(); +} + +pub inline fn delay(ms: u32) void { + return c.SDL_Delay(ms); +} + +pub inline fn delayNS(ns: u64) void { + return c.SDL_DelayNS(ns); +} + +pub inline fn delayPrecise(ns: u64) void { + return c.SDL_DelayPrecise(ns); +} + +pub const TimerID = u32; + +pub const TimerCallback = c.SDL_TimerCallback; + +pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimer(interval, callback, userdata); +} + +pub const NSTimerCallback = c.SDL_NSTimerCallback; + +pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID { + return c.SDL_AddTimerNS(interval, callback, userdata); +} + +pub inline fn removeTimer(id: TimerID) bool { + return @bitCast(c.SDL_RemoveTimer(id)); +} diff --git a/official/release-3.4.8/api/touch.zig b/official/release-3.4.8/api/touch.zig new file mode 100644 index 0000000..7c54650 --- /dev/null +++ b/official/release-3.4.8/api/touch.zig @@ -0,0 +1,35 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub const TouchID = u64; + +pub const FingerID = u64; + +pub const TouchDeviceType = enum(c_int) { + touchDeviceInvalid = -1, + touchDeviceDirect, //touch screen with window-relative coordinates + touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates + touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates +}; + +pub const Finger = extern struct { + id: FingerID, // the finger ID + x: f32, // the x-axis location of the touch event, normalized (0...1) + y: f32, // the y-axis location of the touch event, normalized (0...1) + pressure: f32, // the quantity of pressure applied, normalized (0...1) +}; + +pub inline fn getTouchDevices(count: ?*c_int) ?*TouchID { + return c.SDL_GetTouchDevices(count); +} + +pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 { + return c.SDL_GetTouchDeviceName(touchID); +} + +pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType { + return @fromBackingInt(@intCast(c.SDL_GetTouchDeviceType(touchID))); +} + +pub inline fn getTouchFingers(touchID: TouchID, count: ?*c_int) [*c]?*Finger { + return @ptrCast(@alignCast(c.SDL_GetTouchFingers(touchID, count))); +} diff --git a/official/release-3.4.8/api/tray.zig b/official/release-3.4.8/api/tray.zig new file mode 100644 index 0000000..08f46e8 --- /dev/null +++ b/official/release-3.4.8/api/tray.zig @@ -0,0 +1,116 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const surface_api = @import("surface.zig"); + +pub const Surface = surface_api.Surface; + +pub const Tray = opaque { + pub inline fn setTrayIcon(tray: *Tray, icon: ?*Surface) void { + return c.SDL_SetTrayIcon(@ptrCast(@alignCast(tray)), @ptrCast(@alignCast(icon))); + } + + pub inline fn setTrayTooltip(tray: *Tray, tooltip: [*c]const u8) void { + return c.SDL_SetTrayTooltip(@ptrCast(@alignCast(tray)), tooltip); + } + + pub inline fn createTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn getTrayMenu(tray: *Tray) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayMenu(@ptrCast(@alignCast(tray))))); + } + + pub inline fn destroyTray(tray: *Tray) void { + return c.SDL_DestroyTray(@ptrCast(@alignCast(tray))); + } +}; + +pub const TrayMenu = opaque { + pub inline fn getTrayEntries(traymenu: *TrayMenu, count: ?*c_int) [*c]?*const TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayEntries(@ptrCast(@alignCast(traymenu)), count))); + } + + pub inline fn insertTrayEntryAt(traymenu: *TrayMenu, pos: c_int, label: [*c]const u8, flags: TrayEntryFlags) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_InsertTrayEntryAt(@ptrCast(@alignCast(traymenu)), pos, label, @bitCast(flags)))); + } + + pub inline fn getTrayMenuParentEntry(traymenu: *TrayMenu) ?*TrayEntry { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentEntry(@ptrCast(@alignCast(traymenu))))); + } + + pub inline fn getTrayMenuParentTray(traymenu: *TrayMenu) ?*Tray { + return @ptrCast(@alignCast(c.SDL_GetTrayMenuParentTray(@ptrCast(@alignCast(traymenu))))); + } +}; + +pub const TrayEntry = opaque { + pub inline fn createTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_CreateTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn getTraySubmenu(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTraySubmenu(@ptrCast(@alignCast(trayentry))))); + } + + pub inline fn removeTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_RemoveTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryLabel(trayentry: *TrayEntry, label: [*c]const u8) void { + return c.SDL_SetTrayEntryLabel(@ptrCast(@alignCast(trayentry)), label); + } + + pub inline fn getTrayEntryLabel(trayentry: *TrayEntry) [*c]const u8 { + return c.SDL_GetTrayEntryLabel(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn setTrayEntryChecked(trayentry: *TrayEntry, checked: bool) void { + return c.SDL_SetTrayEntryChecked(@ptrCast(@alignCast(trayentry)), @bitCast(checked)); + } + + pub inline fn getTrayEntryChecked(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryChecked(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryEnabled(trayentry: *TrayEntry, enabled: bool) void { + return c.SDL_SetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)), @bitCast(enabled)); + } + + pub inline fn getTrayEntryEnabled(trayentry: *TrayEntry) bool { + return @bitCast(c.SDL_GetTrayEntryEnabled(@ptrCast(@alignCast(trayentry)))); + } + + pub inline fn setTrayEntryCallback(trayentry: *TrayEntry, callback: TrayCallback, userdata: ?*anyopaque) void { + return c.SDL_SetTrayEntryCallback(@ptrCast(@alignCast(trayentry)), callback, userdata); + } + + pub inline fn clickTrayEntry(trayentry: *TrayEntry) void { + return c.SDL_ClickTrayEntry(@ptrCast(@alignCast(trayentry))); + } + + pub inline fn getTrayEntryParent(trayentry: *TrayEntry) ?*TrayMenu { + return @ptrCast(@alignCast(c.SDL_GetTrayEntryParent(@ptrCast(@alignCast(trayentry))))); + } +}; + +pub const TrayEntryFlags = packed struct(u32) { + trayentryButton: bool = false, // Make the entry a simple button. Required. + trayentryCheckbox: bool = false, // Make the entry a checkbox. Required. + trayentrySubmenu: bool = false, // Prepare the entry to have a submenu. Required + pad0: u27 = 0, + trayentryChecked: bool = false, // Make the entry checked. This is valid only for checkboxes. Optional. + trayentryDisabled: bool = false, // Make the entry disabled. Optional. + + pub const None = TrayEntryFlags{}; +}; + +pub const TrayCallback = c.SDL_TrayCallback; + +pub inline fn createTray(icon: ?*Surface, tooltip: [*c]const u8) ?*Tray { + return @ptrCast(@alignCast(c.SDL_CreateTray(@ptrCast(@alignCast(icon)), tooltip))); +} + +pub inline fn updateTrays() void { + return c.SDL_UpdateTrays(); +} diff --git a/official/release-3.4.8/api/version.zig b/official/release-3.4.8/api/version.zig new file mode 100644 index 0000000..0c0b4f9 --- /dev/null +++ b/official/release-3.4.8/api/version.zig @@ -0,0 +1,9 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +pub inline fn getVersion() c_int { + return c.SDL_GetVersion(); +} + +pub inline fn getRevision() [*c]const u8 { + return c.SDL_GetRevision(); +} diff --git a/official/release-3.4.8/api/video.zig b/official/release-3.4.8/api/video.zig new file mode 100644 index 0000000..408b91a --- /dev/null +++ b/official/release-3.4.8/api/video.zig @@ -0,0 +1,623 @@ +const std = @import("std"); +pub const c = @import("c.zig").c; +const pixels_api = @import("pixels.zig"); +const rect_api = @import("rect.zig"); +const surface_api = @import("surface.zig"); +const properties_api = @import("properties.zig"); +const stdinc_api = @import("stdinc.zig"); + +pub const PixelFormat = pixels_api.PixelFormat; +pub const Point = rect_api.Point; +pub const Surface = surface_api.Surface; +pub const PropertiesID = properties_api.PropertiesID; +pub const Rect = rect_api.Rect; +pub const FunctionPointer = stdinc_api.FunctionPointer; + +pub const DisplayID = u32; + +pub const WindowID = u32; + +pub const SystemTheme = enum(c_int) { + systemThemeUnknown, //Unknown system theme + systemThemeLight, //Light colored system theme + systemThemeDark, //Dark colored system theme +}; + +pub const DisplayModeData = opaque {}; + +pub const DisplayMode = extern struct { + displayID: DisplayID, // the display this mode is associated with + format: PixelFormat, // pixel format + w: c_int, // width + h: c_int, // height + pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) + refresh_rate: f32, // refresh rate (or 0.0f for unspecified) + refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified) + refresh_rate_denominator: c_int, // precise refresh rate denominator + internal: ?*DisplayModeData, // Private +}; + +pub const DisplayOrientation = enum(c_int) { + orientationUnknown, //The display orientation can't be determined + orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode + orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode + orientationPortrait, //The display is in portrait mode + orientationPortraitFlipped, //The display is in portrait mode, upside down +}; + +pub const Window = opaque { + pub inline fn getDisplayForWindow(window: *Window) DisplayID { + return c.SDL_GetDisplayForWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowPixelDensity(window: *Window) f32 { + return c.SDL_GetWindowPixelDensity(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowDisplayScale(window: *Window) f32 { + return c.SDL_GetWindowDisplayScale(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowFullscreenMode(window: *Window, mode: ?*const DisplayMode) bool { + return @bitCast(c.SDL_SetWindowFullscreenMode(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(mode)))); + } + + pub inline fn getWindowFullscreenMode(window: *Window) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetWindowFullscreenMode(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowICCProfile(window: *Window, size: ?*usize) ?*anyopaque { + return c.SDL_GetWindowICCProfile(@ptrCast(@alignCast(window)), size); + } + + pub inline fn getWindowPixelFormat(window: *Window) PixelFormat { + return @fromBackingInt(@intCast(c.SDL_GetWindowPixelFormat(@ptrCast(@alignCast(window))))); + } + + pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreatePopupWindow(@ptrCast(@alignCast(window)), offset_x, offset_y, w, h, @bitCast(flags)))); + } + + pub inline fn getWindowID(window: *Window) WindowID { + return c.SDL_GetWindowID(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowParent(window: *Window) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowParent(@ptrCast(@alignCast(window))))); + } + + pub inline fn getWindowProperties(window: *Window) PropertiesID { + return c.SDL_GetWindowProperties(@ptrCast(@alignCast(window))); + } + + pub inline fn getWindowFlags(window: *Window) WindowFlags { + return @bitCast(c.SDL_GetWindowFlags(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool { + return @bitCast(c.SDL_SetWindowTitle(@ptrCast(@alignCast(window)), title)); + } + + pub inline fn getWindowTitle(window: *Window) [*c]const u8 { + return c.SDL_GetWindowTitle(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowIcon(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(icon)))); + } + + pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_SetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn getWindowPosition(window: *Window, x: ?*c_int, y: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowPosition(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool { + return @bitCast(c.SDL_SetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetWindowSafeArea(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool { + return @bitCast(c.SDL_SetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowAspectRatio(window: *Window, min_aspect: ?*f32, max_aspect: ?*f32) bool { + return @bitCast(c.SDL_GetWindowAspectRatio(@ptrCast(@alignCast(window)), min_aspect, max_aspect)); + } + + pub inline fn getWindowBordersSize(window: *Window, top: ?*c_int, left: ?*c_int, bottom: ?*c_int, right: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowBordersSize(@ptrCast(@alignCast(window)), top, left, bottom, right)); + } + + pub inline fn getWindowSizeInPixels(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSizeInPixels(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMinimumSize(@ptrCast(@alignCast(window)), min_w, min_h)); + } + + pub inline fn getWindowMinimumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMinimumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool { + return @bitCast(c.SDL_SetWindowMaximumSize(@ptrCast(@alignCast(window)), max_w, max_h)); + } + + pub inline fn getWindowMaximumSize(window: *Window, w: ?*c_int, h: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowMaximumSize(@ptrCast(@alignCast(window)), w, h)); + } + + pub inline fn setWindowBordered(window: *Window, bordered: bool) bool { + return @bitCast(c.SDL_SetWindowBordered(@ptrCast(@alignCast(window)), @bitCast(bordered))); + } + + pub inline fn setWindowResizable(window: *Window, resizable: bool) bool { + return @bitCast(c.SDL_SetWindowResizable(@ptrCast(@alignCast(window)), @bitCast(resizable))); + } + + pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool { + return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(@alignCast(window)), @bitCast(on_top))); + } + + pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { + return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(@alignCast(window)), @bitCast(fill))); + } + + pub inline fn showWindow(window: *Window) bool { + return @bitCast(c.SDL_ShowWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn hideWindow(window: *Window) bool { + return @bitCast(c.SDL_HideWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn raiseWindow(window: *Window) bool { + return @bitCast(c.SDL_RaiseWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn maximizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MaximizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn minimizeWindow(window: *Window) bool { + return @bitCast(c.SDL_MinimizeWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn restoreWindow(window: *Window) bool { + return @bitCast(c.SDL_RestoreWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool { + return @bitCast(c.SDL_SetWindowFullscreen(@ptrCast(@alignCast(window)), @bitCast(fullscreen))); + } + + pub inline fn syncWindow(window: *Window) bool { + return @bitCast(c.SDL_SyncWindow(@ptrCast(@alignCast(window)))); + } + + pub inline fn windowHasSurface(window: *Window) bool { + return @bitCast(c.SDL_WindowHasSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowSurface(window: *Window) ?*Surface { + return @ptrCast(@alignCast(c.SDL_GetWindowSurface(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool { + return @bitCast(c.SDL_SetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn getWindowSurfaceVSync(window: *Window, vsync: ?*c_int) bool { + return @bitCast(c.SDL_GetWindowSurfaceVSync(@ptrCast(@alignCast(window)), vsync)); + } + + pub inline fn updateWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_UpdateWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn updateWindowSurfaceRects(window: *Window, rects: ?*const Rect, numrects: c_int) bool { + return @bitCast(c.SDL_UpdateWindowSurfaceRects(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rects)), numrects)); + } + + pub inline fn destroyWindowSurface(window: *Window) bool { + return @bitCast(c.SDL_DestroyWindowSurface(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowKeyboardGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool { + return @bitCast(c.SDL_SetWindowMouseGrab(@ptrCast(@alignCast(window)), @bitCast(grabbed))); + } + + pub inline fn getWindowKeyboardGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowKeyboardGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn getWindowMouseGrab(window: *Window) bool { + return @bitCast(c.SDL_GetWindowMouseGrab(@ptrCast(@alignCast(window)))); + } + + pub inline fn setWindowMouseRect(window: *Window, rect: ?*const Rect) bool { + return @bitCast(c.SDL_SetWindowMouseRect(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(rect)))); + } + + pub inline fn getWindowMouseRect(window: *Window) ?*const Rect { + return @ptrCast(@alignCast(c.SDL_GetWindowMouseRect(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool { + return @bitCast(c.SDL_SetWindowOpacity(@ptrCast(@alignCast(window)), opacity)); + } + + pub inline fn getWindowOpacity(window: *Window) f32 { + return c.SDL_GetWindowOpacity(@ptrCast(@alignCast(window))); + } + + pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool { + return @bitCast(c.SDL_SetWindowParent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(parent)))); + } + + pub inline fn setWindowModal(window: *Window, modal: bool) bool { + return @bitCast(c.SDL_SetWindowModal(@ptrCast(@alignCast(window)), @bitCast(modal))); + } + + pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool { + return @bitCast(c.SDL_SetWindowFocusable(@ptrCast(@alignCast(window)), @bitCast(focusable))); + } + + pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool { + return @bitCast(c.SDL_ShowWindowSystemMenu(@ptrCast(@alignCast(window)), x, y)); + } + + pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool { + return @bitCast(c.SDL_SetWindowHitTest(@ptrCast(@alignCast(window)), callback, callback_data)); + } + + pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool { + return @bitCast(c.SDL_SetWindowShape(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(shape)))); + } + + pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool { + return @bitCast(c.SDL_FlashWindow(@ptrCast(@alignCast(window)), @intCast(@backingInt(operation)))); + } + + pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { + return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(@alignCast(window)), @intCast(@backingInt(state)))); + } + + pub inline fn getWindowProgressState(window: *Window) ProgressState { + return @fromBackingInt(@intCast(c.SDL_GetWindowProgressState(@ptrCast(@alignCast(window))))); + } + + pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { + return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(@alignCast(window)), value)); + } + + pub inline fn getWindowProgressValue(window: *Window) f32 { + return c.SDL_GetWindowProgressValue(@ptrCast(@alignCast(window))); + } + + pub inline fn destroyWindow(window: *Window) void { + return c.SDL_DestroyWindow(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_CreateContext(window: *Window) GLContext { + return @ptrCast(@alignCast(c.SDL_GL_CreateContext(@ptrCast(@alignCast(window))))); + } + + pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool { + return @bitCast(c.SDL_GL_MakeCurrent(@ptrCast(@alignCast(window)), @ptrCast(@alignCast(context)))); + } + + pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface { + return c.SDL_EGL_GetWindowSurface(@ptrCast(@alignCast(window))); + } + + pub inline fn gl_SwapWindow(window: *Window) bool { + return @bitCast(c.SDL_GL_SwapWindow(@ptrCast(@alignCast(window)))); + } +}; + +pub const WindowFlags = packed struct(u64) { + windowFullscreen: bool = false, // window is in fullscreen mode + windowOpengl: bool = false, // window usable with OpenGL context + windowOccluded: bool = false, // window is occluded + windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible + windowBorderless: bool = false, // no window decoration + windowResizable: bool = false, // window can be resized + windowMinimized: bool = false, // window is minimized + windowMaximized: bool = false, // window is maximized + windowMouseGrabbed: bool = false, // window has grabbed mouse input + windowInputFocus: bool = false, // window has input focus + windowMouseFocus: bool = false, // window has mouse focus + windowExternal: bool = false, // window not created by SDL + windowModal: bool = false, // window is modal + windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible + windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED) + windowMouseRelativeMode: bool = false, // window has relative mode enabled + windowAlwaysOnTop: bool = false, // window should always be above others + windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list + windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window + windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window + windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input + windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 + pad0: u6 = 0, + windowVulkan: bool = false, // window usable for Vulkan surface + windowMetal: bool = false, // window usable for Metal view + windowTransparent: bool = false, // window with transparent buffer + windowNotFocusable: bool = false, // window should not be focusable + pad1: u31 = 0, + rsvd: bool = false, + + pub const None = WindowFlags{}; +}; + +pub const FlashOperation = enum(c_int) { + flashCancel, //Cancel any window flash state + flashBriefly, //Flash the window briefly to get attention + flashUntilFocused, //Flash the window until it gets focus +}; + +pub const ProgressState = enum(c_int) { + progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() + progressStateNone, //No progress bar is shown + progressStateIndeterminate, //The progress bar is shown in a indeterminate state + progressStateNormal, //The progress bar is shown in a normal state + progressStatePaused, //The progress bar is shown in a paused state + progressStateError, //The progress bar is shown in a state indicating the application had an error +}; + +pub const GLContext = ?*anyopaque; + +pub const EGLDisplay = ?*anyopaque; + +pub const EGLConfig = ?*anyopaque; + +pub const EGLSurface = ?*anyopaque; + +pub const EGLAttrib = isize; + +pub const EGLint = c_int; + +pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback; + +pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback; + +pub const GLAttr = enum(c_int) { + glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 8. + glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. + glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. + glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0. + glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on. + glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16. + glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0. + glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. + glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. + glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. + glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. + glStereo, //whether the output is stereo 3D; defaults to off. + glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0. + glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing. + glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. + glRetainedBacking, //not used (deprecated). + glContextMajorVersion, //OpenGL context major version. + glContextMinorVersion, //OpenGL context minor version. + glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. + glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. + glShareWithCurrentContext, //OpenGL context sharing; defaults to 0. + glFramebufferSrgbCapable, //requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. + glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. + glContextNoError, + glFloatbuffers, + glEglPlatform, +}; + +pub const GLProfile = u32; + +pub const GLContextFlag = u32; + +pub const GLContextReleaseFlag = u32; + +pub const GLContextResetNotification = u32; + +pub inline fn getNumVideoDrivers() c_int { + return c.SDL_GetNumVideoDrivers(); +} + +pub inline fn getVideoDriver(index: c_int) [*c]const u8 { + return c.SDL_GetVideoDriver(index); +} + +pub inline fn getCurrentVideoDriver() [*c]const u8 { + return c.SDL_GetCurrentVideoDriver(); +} + +pub inline fn getSystemTheme() SystemTheme { + return @fromBackingInt(@intCast(c.SDL_GetSystemTheme())); +} + +pub inline fn getDisplays(count: ?*c_int) ?*DisplayID { + return c.SDL_GetDisplays(count); +} + +pub inline fn getPrimaryDisplay() DisplayID { + return c.SDL_GetPrimaryDisplay(); +} + +pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID { + return c.SDL_GetDisplayProperties(displayID); +} + +pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 { + return c.SDL_GetDisplayName(displayID); +} + +pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool { + return @bitCast(c.SDL_GetDisplayUsableBounds(displayID, @ptrCast(@alignCast(rect)))); +} + +pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetNaturalDisplayOrientation(displayID))); +} + +pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation { + return @fromBackingInt(@intCast(c.SDL_GetCurrentDisplayOrientation(displayID))); +} + +pub inline fn getDisplayContentScale(displayID: DisplayID) f32 { + return c.SDL_GetDisplayContentScale(displayID); +} + +pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: ?*c_int) [*c]?*DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetFullscreenDisplayModes(displayID, count))); +} + +pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, closest: ?*DisplayMode) bool { + return @bitCast(c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, @bitCast(include_high_density_modes), @ptrCast(@alignCast(closest)))); +} + +pub inline fn getDesktopDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetDesktopDisplayMode(displayID))); +} + +pub inline fn getCurrentDisplayMode(displayID: DisplayID) ?*const DisplayMode { + return @ptrCast(@alignCast(c.SDL_GetCurrentDisplayMode(displayID))); +} + +pub inline fn getDisplayForPoint(point: ?*const Point) DisplayID { + return c.SDL_GetDisplayForPoint(@ptrCast(@alignCast(point))); +} + +pub inline fn getDisplayForRect(rect: ?*const Rect) DisplayID { + return c.SDL_GetDisplayForRect(@ptrCast(@alignCast(rect))); +} + +pub inline fn getWindows(count: ?*c_int) [*c]?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindows(count))); +} + +pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindow(title, w, h, @bitCast(flags)))); +} + +pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window { + return @ptrCast(@alignCast(c.SDL_CreateWindowWithProperties(props))); +} + +pub inline fn getWindowFromID(id: WindowID) ?*Window { + return @ptrCast(@alignCast(c.SDL_GetWindowFromID(id))); +} + +pub inline fn getGrabbedWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GetGrabbedWindow())); +} + +pub const HitTestResult = enum(c_int) { + hittestNormal, //Region is normal. No special properties. + hittestDraggable, //Region can drag entire window. + hittestResizeTopleft, //Region is the resizable top-left corner border. + hittestResizeTop, //Region is the resizable top border. + hittestResizeTopright, //Region is the resizable top-right corner border. + hittestResizeRight, //Region is the resizable right border. + hittestResizeBottomright, //Region is the resizable bottom-right corner border. + hittestResizeBottom, //Region is the resizable bottom border. + hittestResizeBottomleft, //Region is the resizable bottom-left corner border. + hittestResizeLeft, //Region is the resizable left border. +}; + +pub const HitTest = c.SDL_HitTest; + +pub inline fn screenSaverEnabled() bool { + return @bitCast(c.SDL_ScreenSaverEnabled()); +} + +pub inline fn enableScreenSaver() bool { + return @bitCast(c.SDL_EnableScreenSaver()); +} + +pub inline fn disableScreenSaver() bool { + return @bitCast(c.SDL_DisableScreenSaver()); +} + +pub inline fn gl_LoadLibrary(path: [*c]const u8) bool { + return @bitCast(c.SDL_GL_LoadLibrary(path)); +} + +pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_GL_GetProcAddress(proc); +} + +pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer { + return c.SDL_EGL_GetProcAddress(proc); +} + +pub inline fn gl_UnloadLibrary() void { + return c.SDL_GL_UnloadLibrary(); +} + +pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool { + return @bitCast(c.SDL_GL_ExtensionSupported(extension)); +} + +pub inline fn gl_ResetAttributes() void { + return c.SDL_GL_ResetAttributes(); +} + +pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool { + return @bitCast(c.SDL_GL_SetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetAttribute(attr: GLAttr, value: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetAttribute(@intCast(@backingInt(attr)), value)); +} + +pub inline fn gl_GetCurrentWindow() ?*Window { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentWindow())); +} + +pub inline fn gl_GetCurrentContext() GLContext { + return @ptrCast(@alignCast(c.SDL_GL_GetCurrentContext())); +} + +pub inline fn egl_GetCurrentDisplay() EGLDisplay { + return c.SDL_EGL_GetCurrentDisplay(); +} + +pub inline fn egl_GetCurrentConfig() EGLConfig { + return c.SDL_EGL_GetCurrentConfig(); +} + +pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void { + return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata); +} + +pub inline fn gl_SetSwapInterval(interval: c_int) bool { + return @bitCast(c.SDL_GL_SetSwapInterval(interval)); +} + +pub inline fn gl_GetSwapInterval(interval: ?*c_int) bool { + return @bitCast(c.SDL_GL_GetSwapInterval(interval)); +} + +pub inline fn gl_DestroyContext(context: GLContext) bool { + return @bitCast(c.SDL_GL_DestroyContext(@ptrCast(@alignCast(context)))); +} diff --git a/official/release-3.4.8/json/audio.json b/official/release-3.4.8/json/audio.json new file mode 100644 index 0000000..49dec69 --- /dev/null +++ b/official/release-3.4.8/json/audio.json @@ -0,0 +1,918 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + { + "name": "SDL_AudioStream" + } + ], + "typedefs": [ + { + "name": "SDL_AudioDeviceID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "SDL_AudioStreamCallback" + }, + { + "name": "SDL_AudioPostmixCallback" + } + ], + "enums": [ + { + "name": "SDL_AudioFormat", + "values": [ + { + "name": "SDL_AUDIO_UNKNOWN", + "value": "0x0000u", + "comment": "Unspecified audio format" + }, + { + "name": "SDL_AUDIO_U8", + "value": "0x0008u", + "comment": "Unsigned 8-bit samples" + }, + { + "name": "SDL_AUDIO_S8", + "value": "0x8008u", + "comment": "Signed 8-bit samples" + }, + { + "name": "SDL_AUDIO_S16LE", + "value": "0x8010u", + "comment": "Signed 16-bit samples" + }, + { + "name": "SDL_AUDIO_S16BE", + "value": "0x9010u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S32LE", + "value": "0x8020u", + "comment": "32-bit integer samples" + }, + { + "name": "SDL_AUDIO_S32BE", + "value": "0x9020u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_F32LE", + "value": "0x8120u", + "comment": "32-bit floating point samples" + }, + { + "name": "SDL_AUDIO_F32BE", + "value": "0x9120u", + "comment": "As above, but big-endian byte order" + }, + { + "name": "SDL_AUDIO_S16", + "value": "SDL_AUDIO_S16LE" + }, + { + "name": "SDL_AUDIO_S32", + "value": "SDL_AUDIO_S32LE" + }, + { + "name": "SDL_AUDIO_F32", + "value": "SDL_AUDIO_F32LE" + } + ] + } + ], + "structs": [ + { + "name": "SDL_AudioSpec", + "fields": [ + { + "name": "format", + "type": "SDL_AudioFormat", + "comment": "Audio data format" + }, + { + "name": "channels", + "type": "int", + "comment": "Number of channels: 1 mono, 2 stereo, etc" + }, + { + "name": "freq", + "type": "int", + "comment": "sample rate: sample frames per second" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumAudioDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetAudioDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentAudioDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAudioPlaybackDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioRecordingDevices", + "return_type": "SDL_AudioDeviceID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceFormat", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "sample_frames", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioDeviceChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_OpenAudioDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_IsAudioDevicePhysical", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_IsAudioDevicePlayback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_PauseAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_ResumeAudioDevice", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_AudioDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_GetAudioDeviceGain", + "return_type": "float", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_SetAudioDeviceGain", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_CloseAudioDevice", + "return_type": "void", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + } + ] + }, + { + "name": "SDL_BindAudioStreams", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_BindAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnbindAudioStreams", + "return_type": "void", + "parameters": [ + { + "name": "streams", + "type": "SDL_AudioStream * const *" + }, + { + "name": "num_streams", + "type": "int" + } + ] + }, + { + "name": "SDL_UnbindAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamDevice", + "return_type": "SDL_AudioDeviceID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_CreateAudioStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFormat", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + } + ] + }, + { + "name": "SDL_GetAudioStreamFrequencyRatio", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamFrequencyRatio", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "ratio", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamGain", + "return_type": "float", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGain", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "gain", + "type": "float" + } + ] + }, + { + "name": "SDL_GetAudioStreamInputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioStreamOutputChannelMap", + "return_type": "int *", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetAudioStreamInputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_SetAudioStreamOutputChannelMap", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "chmap", + "type": "const int *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_PutAudioStreamDataNoCopy", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "const void *" + }, + { + "name": "len", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_AudioStreamDataCompleteCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_PutAudioStreamPlanarData", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "channel_buffers", + "type": "const void * const *" + }, + { + "name": "num_channels", + "type": "int" + }, + { + "name": "num_samples", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamData", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "buf", + "type": "void *" + }, + { + "name": "len", + "type": "int" + } + ] + }, + { + "name": "SDL_GetAudioStreamAvailable", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_GetAudioStreamQueued", + "return_type": "int", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_FlushAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ClearAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_PauseAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_ResumeAudioStreamDevice", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_AudioStreamDevicePaused", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_LockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_UnlockAudioStream", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_SetAudioStreamGetCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioStreamPutCallback", + "return_type": "bool", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyAudioStream", + "return_type": "void", + "parameters": [ + { + "name": "stream", + "type": "SDL_AudioStream *" + } + ] + }, + { + "name": "SDL_OpenAudioDeviceStream", + "return_type": "SDL_AudioStream *", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "callback", + "type": "SDL_AudioStreamCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetAudioPostmixCallback", + "return_type": "bool", + "parameters": [ + { + "name": "devid", + "type": "SDL_AudioDeviceID" + }, + { + "name": "callback", + "type": "SDL_AudioPostmixCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_LoadWAV_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_LoadWAV", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "spec", + "type": "SDL_AudioSpec *" + }, + { + "name": "audio_buf", + "type": "Uint8 **" + }, + { + "name": "audio_len", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_MixAudio", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "Uint8 *" + }, + { + "name": "src", + "type": "const Uint8 *" + }, + { + "name": "format", + "type": "SDL_AudioFormat" + }, + { + "name": "len", + "type": "Uint32" + }, + { + "name": "volume", + "type": "float" + } + ] + }, + { + "name": "SDL_ConvertAudioSamples", + "return_type": "bool", + "parameters": [ + { + "name": "src_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "src_data", + "type": "const Uint8 *" + }, + { + "name": "src_len", + "type": "int" + }, + { + "name": "dst_spec", + "type": "const SDL_AudioSpec *" + }, + { + "name": "dst_data", + "type": "Uint8 **" + }, + { + "name": "dst_len", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetAudioFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + }, + { + "name": "SDL_GetSilenceValueForFormat", + "return_type": "int", + "parameters": [ + { + "name": "format", + "type": "SDL_AudioFormat" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/blendmode.json b/official/release-3.4.8/json/blendmode.json new file mode 100644 index 0000000..d80e56a --- /dev/null +++ b/official/release-3.4.8/json/blendmode.json @@ -0,0 +1,134 @@ +{ + "header": "SDL_blendmode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_BlendMode", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_BlendOperation", + "values": [ + { + "name": "SDL_BLENDOPERATION_ADD", + "value": "0x1", + "comment": "dst + src: supported by all renderers" + }, + { + "name": "SDL_BLENDOPERATION_SUBTRACT", + "value": "0x2", + "comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_REV_SUBTRACT", + "value": "0x3", + "comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MINIMUM", + "value": "0x4", + "comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + }, + { + "name": "SDL_BLENDOPERATION_MAXIMUM", + "value": "0x5", + "comment": "max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan" + } + ] + }, + { + "name": "SDL_BlendFactor", + "values": [ + { + "name": "SDL_BLENDFACTOR_ZERO", + "value": "0x1", + "comment": "0, 0, 0, 0" + }, + { + "name": "SDL_BLENDFACTOR_ONE", + "value": "0x2", + "comment": "1, 1, 1, 1" + }, + { + "name": "SDL_BLENDFACTOR_SRC_COLOR", + "value": "0x3", + "comment": "srcR, srcG, srcB, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "value": "0x4", + "comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_SRC_ALPHA", + "value": "0x5", + "comment": "srcA, srcA, srcA, srcA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "value": "0x6", + "comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA" + }, + { + "name": "SDL_BLENDFACTOR_DST_COLOR", + "value": "0x7", + "comment": "dstR, dstG, dstB, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "value": "0x8", + "comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA" + }, + { + "name": "SDL_BLENDFACTOR_DST_ALPHA", + "value": "0x9", + "comment": "dstA, dstA, dstA, dstA" + }, + { + "name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "value": "0xA", + "comment": "1-dstA, 1-dstA, 1-dstA, 1-dstA" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ComposeCustomBlendMode", + "return_type": "SDL_BlendMode", + "parameters": [ + { + "name": "srcColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstColorFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "colorOperation", + "type": "SDL_BlendOperation" + }, + { + "name": "srcAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "dstAlphaFactor", + "type": "SDL_BlendFactor" + }, + { + "name": "alphaOperation", + "type": "SDL_BlendOperation" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/camera.json b/official/release-3.4.8/json/camera.json new file mode 100644 index 0000000..1405b5e --- /dev/null +++ b/official/release-3.4.8/json/camera.json @@ -0,0 +1,248 @@ +{ + "header": "SDL_camera.h", + "opaque_types": [ + { + "name": "SDL_Camera" + } + ], + "typedefs": [ + { + "name": "SDL_CameraID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_CameraPosition", + "values": [ + { + "name": "SDL_CAMERA_POSITION_UNKNOWN" + }, + { + "name": "SDL_CAMERA_POSITION_FRONT_FACING" + }, + { + "name": "SDL_CAMERA_POSITION_BACK_FACING" + } + ] + }, + { + "name": "SDL_CameraPermissionState", + "values": [ + { + "name": "SDL_CAMERA_PERMISSION_STATE_DENIED", + "value": "-1" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" + }, + { + "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CameraSpec", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "Frame format" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace", + "comment": "Frame colorspace" + }, + { + "name": "width", + "type": "int", + "comment": "Frame width" + }, + { + "name": "height", + "type": "int", + "comment": "Frame height" + }, + { + "name": "framerate_numerator", + "type": "int", + "comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)" + }, + { + "name": "framerate_denominator", + "type": "int", + "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumCameraDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetCameraDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentCameraDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetCameras", + "return_type": "SDL_CameraID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraSupportedFormats", + "return_type": "SDL_CameraSpec **", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCameraName", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_GetCameraPosition", + "return_type": "SDL_CameraPosition", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + } + ] + }, + { + "name": "SDL_OpenCamera", + "return_type": "SDL_Camera *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_CameraID" + }, + { + "name": "spec", + "type": "const SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_GetCameraPermissionState", + "return_type": "SDL_CameraPermissionState", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraID", + "return_type": "SDL_CameraID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + }, + { + "name": "SDL_GetCameraFormat", + "return_type": "bool", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "spec", + "type": "SDL_CameraSpec *" + } + ] + }, + { + "name": "SDL_AcquireCameraFrame", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "timestampNS", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReleaseCameraFrame", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + }, + { + "name": "frame", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CloseCamera", + "return_type": "void", + "parameters": [ + { + "name": "camera", + "type": "SDL_Camera *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/clipboard.json b/official/release-3.4.8/json/clipboard.json new file mode 100644 index 0000000..dc2005f --- /dev/null +++ b/official/release-3.4.8/json/clipboard.json @@ -0,0 +1,125 @@ +{ + "header": "SDL_clipboard.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_ClipboardDataCallback" + }, + { + "name": "SDL_ClipboardCleanupCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetClipboardText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasClipboardText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetPrimarySelectionText", + "return_type": "bool", + "parameters": [ + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPrimarySelectionText", + "return_type": "char *", + "parameters": [] + }, + { + "name": "SDL_HasPrimarySelectionText", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SetClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_ClipboardDataCallback" + }, + { + "name": "cleanup", + "type": "SDL_ClipboardCleanupCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "mime_types", + "type": "const char *const *" + }, + { + "name": "num_mime_types", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ClearClipboardData", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetClipboardData", + "return_type": "void *", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_HasClipboardData", + "return_type": "bool", + "parameters": [ + { + "name": "mime_type", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetClipboardMimeTypes", + "return_type": "char **", + "parameters": [ + { + "name": "num_mime_types", + "type": "size_t *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/dialog.json b/official/release-3.4.8/json/dialog.json new file mode 100644 index 0000000..87d9828 --- /dev/null +++ b/official/release-3.4.8/json/dialog.json @@ -0,0 +1,158 @@ +{ + "header": "SDL_dialog.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_DialogFileCallback" + } + ], + "enums": [ + { + "name": "SDL_FileDialogType", + "values": [ + { + "name": "SDL_FILEDIALOG_OPENFILE" + }, + { + "name": "SDL_FILEDIALOG_SAVEFILE" + }, + { + "name": "SDL_FILEDIALOG_OPENFOLDER" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DialogFileFilter", + "fields": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_ShowOpenFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowSaveFileDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "filters", + "type": "const SDL_DialogFileFilter *" + }, + { + "name": "nfilters", + "type": "int" + }, + { + "name": "default_location", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ShowOpenFolderDialog", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "default_location", + "type": "const char *" + }, + { + "name": "allow_many", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowFileDialogWithProperties", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "SDL_FileDialogType" + }, + { + "name": "callback", + "type": "SDL_DialogFileCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/endian.json b/official/release-3.4.8/json/endian.json new file mode 100644 index 0000000..e49ba98 --- /dev/null +++ b/official/release-3.4.8/json/endian.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_endian.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/error.json b/official/release-3.4.8/json/error.json new file mode 100644 index 0000000..8fc1d5a --- /dev/null +++ b/official/release-3.4.8/json/error.json @@ -0,0 +1,28 @@ +{ + "header": "SDL_error.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OutOfMemory", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetError", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_ClearError", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/events.json b/official/release-3.4.8/json/events.json new file mode 100644 index 0000000..f7c6aa7 --- /dev/null +++ b/official/release-3.4.8/json/events.json @@ -0,0 +1,2529 @@ +{ + "header": "SDL_events.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EventFilter" + } + ], + "enums": [ + { + "name": "SDL_EventType", + "values": [ + { + "name": "SDL_EVENT_FIRST", + "value": "0", + "comment": "Unused (do not remove)" + }, + { + "name": "SDL_EVENT_QUIT", + "value": "0x100", + "comment": "User-requested quit" + }, + { + "name": "SDL_EVENT_TERMINATING", + "comment": "The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()" + }, + { + "name": "SDL_EVENT_LOW_MEMORY", + "comment": "The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_BACKGROUND", + "comment": "The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_DID_ENTER_BACKGROUND", + "comment": "The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()" + }, + { + "name": "SDL_EVENT_WILL_ENTER_FOREGROUND", + "comment": "The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_DID_ENTER_FOREGROUND", + "comment": "The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()" + }, + { + "name": "SDL_EVENT_LOCALE_CHANGED", + "comment": "The user's locale preferences have changed." + }, + { + "name": "SDL_EVENT_SYSTEM_THEME_CHANGED", + "comment": "The system theme changed" + }, + { + "name": "SDL_EVENT_DISPLAY_ORIENTATION", + "value": "0x151", + "comment": "Display orientation has changed to data1" + }, + { + "name": "SDL_EVENT_DISPLAY_ADDED", + "comment": "Display has been added to the system" + }, + { + "name": "SDL_EVENT_DISPLAY_REMOVED", + "comment": "Display has been removed from the system" + }, + { + "name": "SDL_EVENT_DISPLAY_MOVED", + "comment": "Display has changed position" + }, + { + "name": "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED", + "comment": "Display has changed desktop mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED", + "comment": "Display has changed current mode" + }, + { + "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", + "comment": "Display has changed content scale" + }, + { + "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", + "comment": "Display has changed usable bounds" + }, + { + "name": "SDL_EVENT_DISPLAY_FIRST", + "value": "SDL_EVENT_DISPLAY_ORIENTATION" + }, + { + "name": "SDL_EVENT_DISPLAY_LAST", + "value": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED" + }, + { + "name": "SDL_EVENT_WINDOW_SHOWN", + "value": "0x202", + "comment": "Window has been shown" + }, + { + "name": "SDL_EVENT_WINDOW_HIDDEN", + "comment": "Window has been hidden" + }, + { + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise." + }, + { + "name": "SDL_EVENT_WINDOW_MOVED", + "comment": "Window has been moved to data1, data2" + }, + { + "name": "SDL_EVENT_WINDOW_RESIZED", + "comment": "Window has been resized to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED", + "comment": "The pixel size of the window has changed to data1xdata2" + }, + { + "name": "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED", + "comment": "The pixel size of a Metal view associated with the window has changed" + }, + { + "name": "SDL_EVENT_WINDOW_MINIMIZED", + "comment": "Window has been minimized" + }, + { + "name": "SDL_EVENT_WINDOW_MAXIMIZED", + "comment": "Window has been maximized" + }, + { + "name": "SDL_EVENT_WINDOW_RESTORED", + "comment": "Window has been restored to normal size and position" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_ENTER", + "comment": "Window has gained mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_MOUSE_LEAVE", + "comment": "Window has lost mouse focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_GAINED", + "comment": "Window has gained keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_FOCUS_LOST", + "comment": "Window has lost keyboard focus" + }, + { + "name": "SDL_EVENT_WINDOW_CLOSE_REQUESTED", + "comment": "The window manager requests that the window be closed" + }, + { + "name": "SDL_EVENT_WINDOW_HIT_TEST", + "comment": "Window had a hit test that wasn't SDL_HITTEST_NORMAL" + }, + { + "name": "SDL_EVENT_WINDOW_ICCPROF_CHANGED", + "comment": "The ICC profile of the window's display has changed" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_CHANGED", + "comment": "Window has been moved to display data1" + }, + { + "name": "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED", + "comment": "Window display scale has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED", + "comment": "The window safe area has been changed" + }, + { + "name": "SDL_EVENT_WINDOW_OCCLUDED", + "comment": "The window has been occluded" + }, + { + "name": "SDL_EVENT_WINDOW_ENTER_FULLSCREEN", + "comment": "The window has entered fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN", + "comment": "The window has left fullscreen mode" + }, + { + "name": "SDL_EVENT_WINDOW_DESTROYED", + "comment": "The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid" + }, + { + "name": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED", + "comment": "Window HDR properties have changed" + }, + { + "name": "SDL_EVENT_WINDOW_FIRST", + "value": "SDL_EVENT_WINDOW_SHOWN" + }, + { + "name": "SDL_EVENT_WINDOW_LAST", + "value": "SDL_EVENT_WINDOW_HDR_STATE_CHANGED" + }, + { + "name": "SDL_EVENT_KEY_DOWN", + "value": "0x300", + "comment": "Key pressed" + }, + { + "name": "SDL_EVENT_KEY_UP", + "comment": "Key released" + }, + { + "name": "SDL_EVENT_TEXT_EDITING", + "comment": "Keyboard text editing (composition)" + }, + { + "name": "SDL_EVENT_TEXT_INPUT", + "comment": "Keyboard text input" + }, + { + "name": "SDL_EVENT_KEYMAP_CHANGED", + "comment": "Keymap changed due to a system event such as an input language or keyboard layout change." + }, + { + "name": "SDL_EVENT_KEYBOARD_ADDED", + "comment": "A new keyboard has been inserted into the system" + }, + { + "name": "SDL_EVENT_KEYBOARD_REMOVED", + "comment": "A keyboard has been removed" + }, + { + "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", + "comment": "Keyboard text editing candidates" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", + "comment": "The on-screen keyboard has been shown" + }, + { + "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", + "comment": "The on-screen keyboard has been hidden" + }, + { + "name": "SDL_EVENT_MOUSE_MOTION", + "value": "0x400", + "comment": "Mouse moved" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_DOWN", + "comment": "Mouse button pressed" + }, + { + "name": "SDL_EVENT_MOUSE_BUTTON_UP", + "comment": "Mouse button released" + }, + { + "name": "SDL_EVENT_MOUSE_WHEEL", + "comment": "Mouse wheel motion" + }, + { + "name": "SDL_EVENT_MOUSE_ADDED", + "comment": "A new mouse has been inserted into the system" + }, + { + "name": "SDL_EVENT_MOUSE_REMOVED", + "comment": "A mouse has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_AXIS_MOTION", + "value": "0x600", + "comment": "Joystick axis motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_BALL_MOTION", + "comment": "Joystick trackball motion" + }, + { + "name": "SDL_EVENT_JOYSTICK_HAT_MOTION", + "comment": "Joystick hat position change" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_DOWN", + "comment": "Joystick button pressed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BUTTON_UP", + "comment": "Joystick button released" + }, + { + "name": "SDL_EVENT_JOYSTICK_ADDED", + "comment": "A new joystick has been inserted into the system" + }, + { + "name": "SDL_EVENT_JOYSTICK_REMOVED", + "comment": "An opened joystick has been removed" + }, + { + "name": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED", + "comment": "Joystick battery level change" + }, + { + "name": "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE", + "comment": "Joystick update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_AXIS_MOTION", + "value": "0x650", + "comment": "Gamepad axis motion" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_DOWN", + "comment": "Gamepad button pressed" + }, + { + "name": "SDL_EVENT_GAMEPAD_BUTTON_UP", + "comment": "Gamepad button released" + }, + { + "name": "SDL_EVENT_GAMEPAD_ADDED", + "comment": "A new gamepad has been inserted into the system" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMOVED", + "comment": "A gamepad has been removed" + }, + { + "name": "SDL_EVENT_GAMEPAD_REMAPPED", + "comment": "The gamepad mapping was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN", + "comment": "Gamepad touchpad was touched" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION", + "comment": "Gamepad touchpad finger was moved" + }, + { + "name": "SDL_EVENT_GAMEPAD_TOUCHPAD_UP", + "comment": "Gamepad touchpad finger was lifted" + }, + { + "name": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE", + "comment": "Gamepad sensor was updated" + }, + { + "name": "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE", + "comment": "Gamepad update is complete" + }, + { + "name": "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED", + "comment": "Gamepad Steam handle has changed" + }, + { + "name": "SDL_EVENT_FINGER_DOWN", + "value": "0x700" + }, + { + "name": "SDL_EVENT_FINGER_UP" + }, + { + "name": "SDL_EVENT_FINGER_MOTION" + }, + { + "name": "SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "SDL_EVENT_PINCH_BEGIN", + "value": "0x710", + "comment": "Pinch gesture started" + }, + { + "name": "SDL_EVENT_PINCH_UPDATE", + "comment": "Pinch gesture updated" + }, + { + "name": "SDL_EVENT_PINCH_END", + "comment": "Pinch gesture ended" + }, + { + "name": "SDL_EVENT_CLIPBOARD_UPDATE", + "value": "0x900", + "comment": "The clipboard changed" + }, + { + "name": "SDL_EVENT_DROP_FILE", + "value": "0x1000", + "comment": "The system requests a file open" + }, + { + "name": "SDL_EVENT_DROP_TEXT", + "comment": "text/plain drag-and-drop event" + }, + { + "name": "SDL_EVENT_DROP_BEGIN", + "comment": "A new set of drops is beginning (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_COMPLETE", + "comment": "Current set of drops is now complete (NULL filename)" + }, + { + "name": "SDL_EVENT_DROP_POSITION", + "comment": "Position while moving over the window" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_ADDED", + "value": "0x1100", + "comment": "A new audio device is available" + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_REMOVED", + "comment": "An audio device has been removed." + }, + { + "name": "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED", + "comment": "An audio device's format has been changed by the system." + }, + { + "name": "SDL_EVENT_SENSOR_UPDATE", + "value": "0x1200", + "comment": "A sensor was updated" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_IN", + "value": "0x1300", + "comment": "Pressure-sensitive pen has become available" + }, + { + "name": "SDL_EVENT_PEN_PROXIMITY_OUT", + "comment": "Pressure-sensitive pen has become unavailable" + }, + { + "name": "SDL_EVENT_PEN_DOWN", + "comment": "Pressure-sensitive pen touched drawing surface" + }, + { + "name": "SDL_EVENT_PEN_UP", + "comment": "Pressure-sensitive pen stopped touching drawing surface" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_DOWN", + "comment": "Pressure-sensitive pen button pressed" + }, + { + "name": "SDL_EVENT_PEN_BUTTON_UP", + "comment": "Pressure-sensitive pen button released" + }, + { + "name": "SDL_EVENT_PEN_MOTION", + "comment": "Pressure-sensitive pen is moving on the tablet" + }, + { + "name": "SDL_EVENT_PEN_AXIS", + "comment": "Pressure-sensitive pen angle/pressure/etc changed" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_ADDED", + "value": "0x1400", + "comment": "A new camera device is available" + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_REMOVED", + "comment": "A camera device has been removed." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_APPROVED", + "comment": "A camera device has been approved for use by the user." + }, + { + "name": "SDL_EVENT_CAMERA_DEVICE_DENIED", + "comment": "A camera device has been denied for use by the user." + }, + { + "name": "SDL_EVENT_RENDER_TARGETS_RESET", + "value": "0x2000", + "comment": "The render targets have been reset and their contents need to be updated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_RESET", + "comment": "The device has been reset and all textures need to be recreated" + }, + { + "name": "SDL_EVENT_RENDER_DEVICE_LOST", + "comment": "The device has been lost and can't be recovered." + }, + { + "name": "SDL_EVENT_PRIVATE0", + "value": "0x4000" + }, + { + "name": "SDL_EVENT_PRIVATE1" + }, + { + "name": "SDL_EVENT_PRIVATE2" + }, + { + "name": "SDL_EVENT_PRIVATE3" + }, + { + "name": "SDL_EVENT_POLL_SENTINEL", + "value": "0x7F00", + "comment": "Signals the end of an event poll cycle" + }, + { + "name": "SDL_EVENT_USER", + "value": "0x8000" + }, + { + "name": "SDL_EVENT_LAST", + "value": "0xFFFF" + }, + { + "name": "SDL_EVENT_ENUM_PADDING", + "value": "0x7FFFFFFF" + } + ] + }, + { + "name": "SDL_EventAction", + "values": [ + { + "name": "SDL_ADDEVENT", + "comment": "Add events to the back of the queue." + }, + { + "name": "SDL_PEEKEVENT", + "comment": "Check but don't remove events from the queue front." + }, + { + "name": "SDL_GETEVENT", + "comment": "Retrieve/remove events from the front of the queue." + } + ] + } + ], + "structs": [ + { + "name": "SDL_CommonEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_DisplayEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DISPLAY_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "The associated display" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_WindowEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_WINDOW_*" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window" + }, + { + "name": "data1", + "type": "Sint32", + "comment": "event dependent data" + }, + { + "name": "data2", + "type": "Sint32", + "comment": "event dependent data" + } + ] + }, + { + "name": "SDL_KeyboardDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id" + } + ] + }, + { + "name": "SDL_KeyboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "which", + "type": "SDL_KeyboardID", + "comment": "The keyboard instance id, or 0 if unknown or virtual" + }, + { + "name": "scancode", + "type": "SDL_Scancode", + "comment": "SDL physical key code" + }, + { + "name": "key", + "type": "SDL_Keycode", + "comment": "SDL virtual key code" + }, + { + "name": "mod", + "type": "SDL_Keymod", + "comment": "current key modifiers" + }, + { + "name": "raw", + "type": "Uint16", + "comment": "The platform dependent scancode for this event" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the key is pressed" + }, + { + "name": "repeat", + "type": "bool", + "comment": "true if this is a key repeat" + } + ] + }, + { + "name": "SDL_TextEditingEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The editing text" + }, + { + "name": "start", + "type": "Sint32", + "comment": "The start cursor of selected editing text, or -1 if not set" + }, + { + "name": "length", + "type": "Sint32", + "comment": "The length of selected editing text, or -1 if not set" + } + ] + }, + { + "name": "SDL_TextEditingCandidatesEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_EDITING_CANDIDATES" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "candidates", + "type": "const char * const *", + "comment": "The list of candidates, or NULL if there are no candidates available" + }, + { + "name": "num_candidates", + "type": "Sint32", + "comment": "The number of strings in `candidates`" + }, + { + "name": "selected_candidate", + "type": "Sint32", + "comment": "The index of the selected candidate, or -1 if no candidate is selected" + }, + { + "name": "horizontal", + "type": "bool", + "comment": "true if the list is horizontal, false if it's vertical" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_TextInputEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_TEXT_INPUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with keyboard focus, if any" + }, + { + "name": "text", + "type": "const char *", + "comment": "The input text, UTF-8 encoded" + } + ] + }, + { + "name": "SDL_MouseDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id" + } + ] + }, + { + "name": "SDL_MouseMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "state", + "type": "SDL_MouseButtonFlags", + "comment": "The current button state" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "xrel", + "type": "float", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "float", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_MouseButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The mouse button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "clicks", + "type": "Uint8", + "comment": "1 for single-click, 2 for double-click, etc." + }, + { + "name": "padding", + "type": "Uint8" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_MouseWheelEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_MOUSE_WHEEL" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_MouseID", + "comment": "The mouse instance id in relative mode or 0" + }, + { + "name": "x", + "type": "float", + "comment": "The amount scrolled horizontally, positive to the right and negative to the left" + }, + { + "name": "y", + "type": "float", + "comment": "The amount scrolled vertically, positive away from the user and negative toward the user" + }, + { + "name": "direction", + "type": "SDL_MouseWheelDirection", + "comment": "Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back" + }, + { + "name": "mouse_x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "mouse_y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "integer_x", + "type": "Sint32", + "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + }, + { + "name": "integer_y", + "type": "Sint32", + "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" + } + ] + }, + { + "name": "SDL_JoyAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The joystick axis index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_JoyBallEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BALL_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "ball", + "type": "Uint8", + "comment": "The joystick trackball index" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "xrel", + "type": "Sint16", + "comment": "The relative motion in the X direction" + }, + { + "name": "yrel", + "type": "Sint16", + "comment": "The relative motion in the Y direction" + } + ] + }, + { + "name": "SDL_JoyHatEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_HAT_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "hat", + "type": "Uint8", + "comment": "The joystick hat index" + }, + { + "name": "value", + "type": "Uint8" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The joystick button index" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_JoyDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_JoyBatteryEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_JOYSTICK_BATTERY_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "state", + "type": "SDL_PowerState", + "comment": "The joystick battery state" + }, + { + "name": "percent", + "type": "int", + "comment": "The joystick battery percent charge remaining" + } + ] + }, + { + "name": "SDL_GamepadAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_AXIS_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "axis", + "type": "Uint8", + "comment": "The gamepad axis (SDL_GamepadAxis)" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + }, + { + "name": "value", + "type": "Sint16", + "comment": "The axis value (range: -32768 to 32767)" + }, + { + "name": "padding4", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_GamepadButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The gamepad button (SDL_GamepadButton)" + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GamepadDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + } + ] + }, + { + "name": "SDL_GamepadTouchpadEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "touchpad", + "type": "Sint32", + "comment": "The index of the touchpad" + }, + { + "name": "finger", + "type": "Sint32", + "comment": "The index of the finger on the touchpad" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being on the left" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1 with 0 being at the top" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + } + ] + }, + { + "name": "SDL_GamepadSensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_GAMEPAD_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_JoystickID", + "comment": "The joystick instance id" + }, + { + "name": "sensor", + "type": "Sint32", + "comment": "The type of the sensor, one of the values of SDL_SensorType" + }, + { + "name": "data", + "type": "float[3]", + "comment": "Up to 3 values from the sensor, as defined in SDL_sensor.h" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_AudioDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_AudioDeviceID", + "comment": "SDL_AudioDeviceID for the device being added or removed or changing" + }, + { + "name": "recording", + "type": "bool", + "comment": "false if a playback device, true if a recording device." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_CameraDeviceEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_CameraID", + "comment": "SDL_CameraID for the device being added or removed or changing" + } + ] + }, + { + "name": "SDL_RenderEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window containing the renderer in question." + } + ] + }, + { + "name": "SDL_TouchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "touchID", + "type": "SDL_TouchID", + "comment": "The touch device id" + }, + { + "name": "fingerID", + "type": "SDL_FingerID" + }, + { + "name": "x", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "y", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "dx", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "dy", + "type": "float", + "comment": "Normalized in the range -1...1" + }, + { + "name": "pressure", + "type": "float", + "comment": "Normalized in the range 0...1" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PinchFingerEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "scale", + "type": "float", + "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window underneath the finger, if any" + } + ] + }, + { + "name": "SDL_PenProximityEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + } + ] + }, + { + "name": "SDL_PenMotionEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_MOTION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + } + ] + }, + { + "name": "SDL_PenTouchEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "eraser", + "type": "bool", + "comment": "true if eraser end is used (not all pens support this)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the pen is touching or false if the pen is lifted off" + } + ] + }, + { + "name": "SDL_PenButtonEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with mouse focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "button", + "type": "Uint8", + "comment": "The pen button index (first button is 1)." + }, + { + "name": "down", + "type": "bool", + "comment": "true if the button is pressed" + } + ] + }, + { + "name": "SDL_PenAxisEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_PEN_AXIS" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window with pen focus, if any" + }, + { + "name": "which", + "type": "SDL_PenID", + "comment": "The pen instance id" + }, + { + "name": "pen_state", + "type": "SDL_PenInputFlags", + "comment": "Complete pen input state at time of event" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window" + }, + { + "name": "axis", + "type": "SDL_PenAxis", + "comment": "Axis that has changed" + }, + { + "name": "value", + "type": "float", + "comment": "New value of axis" + } + ] + }, + { + "name": "SDL_DropEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The window that was dropped on, if any" + }, + { + "name": "x", + "type": "float", + "comment": "X coordinate, relative to window (not on begin)" + }, + { + "name": "y", + "type": "float", + "comment": "Y coordinate, relative to window (not on begin)" + }, + { + "name": "source", + "type": "const char *", + "comment": "The source app that sent this drop event, or NULL if that isn't available" + }, + { + "name": "data", + "type": "const char *", + "comment": "The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events" + } + ] + }, + { + "name": "SDL_ClipboardEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_CLIPBOARD_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "owner", + "type": "bool", + "comment": "are we owning the clipboard (internal update)" + }, + { + "name": "num_mime_types", + "type": "Sint32", + "comment": "number of mime types" + }, + { + "name": "mime_types", + "type": "const char **", + "comment": "current mime types" + } + ] + }, + { + "name": "SDL_SensorEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_SENSOR_UPDATE" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "which", + "type": "SDL_SensorID", + "comment": "The instance ID of the sensor" + }, + { + "name": "data", + "type": "float[6]", + "comment": "Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()" + }, + { + "name": "sensor_timestamp", + "type": "Uint64", + "comment": "The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock" + } + ] + }, + { + "name": "SDL_QuitEvent", + "fields": [ + { + "name": "_type", + "type": "SDL_EventType", + "comment": "SDL_EVENT_QUIT" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + } + ] + }, + { + "name": "SDL_UserEvent", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + }, + { + "name": "reserved", + "type": "Uint32" + }, + { + "name": "timestamp", + "type": "Uint64", + "comment": "In nanoseconds, populated using SDL_GetTicksNS()" + }, + { + "name": "windowID", + "type": "SDL_WindowID", + "comment": "The associated window if any" + }, + { + "name": "code", + "type": "Sint32", + "comment": "User defined event code" + }, + { + "name": "data1", + "type": "void *", + "comment": "User defined data pointer" + }, + { + "name": "data2", + "type": "void *", + "comment": "User defined data pointer" + } + ] + } + ], + "unions": [ + { + "name": "SDL_Event", + "fields": [ + { + "name": "_type", + "type": "Uint32", + "comment": "Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration" + }, + { + "name": "common", + "type": "SDL_CommonEvent", + "comment": "Common event data" + }, + { + "name": "display", + "type": "SDL_DisplayEvent", + "comment": "Display event data" + }, + { + "name": "window", + "type": "SDL_WindowEvent", + "comment": "Window event data" + }, + { + "name": "kdevice", + "type": "SDL_KeyboardDeviceEvent", + "comment": "Keyboard device change event data" + }, + { + "name": "key", + "type": "SDL_KeyboardEvent", + "comment": "Keyboard event data" + }, + { + "name": "edit", + "type": "SDL_TextEditingEvent", + "comment": "Text editing event data" + }, + { + "name": "edit_candidates", + "type": "SDL_TextEditingCandidatesEvent", + "comment": "Text editing candidates event data" + }, + { + "name": "text", + "type": "SDL_TextInputEvent", + "comment": "Text input event data" + }, + { + "name": "mdevice", + "type": "SDL_MouseDeviceEvent", + "comment": "Mouse device change event data" + }, + { + "name": "motion", + "type": "SDL_MouseMotionEvent", + "comment": "Mouse motion event data" + }, + { + "name": "button", + "type": "SDL_MouseButtonEvent", + "comment": "Mouse button event data" + }, + { + "name": "wheel", + "type": "SDL_MouseWheelEvent", + "comment": "Mouse wheel event data" + }, + { + "name": "jdevice", + "type": "SDL_JoyDeviceEvent", + "comment": "Joystick device change event data" + }, + { + "name": "jaxis", + "type": "SDL_JoyAxisEvent", + "comment": "Joystick axis event data" + }, + { + "name": "jball", + "type": "SDL_JoyBallEvent", + "comment": "Joystick ball event data" + }, + { + "name": "jhat", + "type": "SDL_JoyHatEvent", + "comment": "Joystick hat event data" + }, + { + "name": "jbutton", + "type": "SDL_JoyButtonEvent", + "comment": "Joystick button event data" + }, + { + "name": "jbattery", + "type": "SDL_JoyBatteryEvent", + "comment": "Joystick battery event data" + }, + { + "name": "gdevice", + "type": "SDL_GamepadDeviceEvent", + "comment": "Gamepad device event data" + }, + { + "name": "gaxis", + "type": "SDL_GamepadAxisEvent", + "comment": "Gamepad axis event data" + }, + { + "name": "gbutton", + "type": "SDL_GamepadButtonEvent", + "comment": "Gamepad button event data" + }, + { + "name": "gtouchpad", + "type": "SDL_GamepadTouchpadEvent", + "comment": "Gamepad touchpad event data" + }, + { + "name": "gsensor", + "type": "SDL_GamepadSensorEvent", + "comment": "Gamepad sensor event data" + }, + { + "name": "adevice", + "type": "SDL_AudioDeviceEvent", + "comment": "Audio device event data" + }, + { + "name": "cdevice", + "type": "SDL_CameraDeviceEvent", + "comment": "Camera device event data" + }, + { + "name": "sensor", + "type": "SDL_SensorEvent", + "comment": "Sensor event data" + }, + { + "name": "quit", + "type": "SDL_QuitEvent", + "comment": "Quit request event data" + }, + { + "name": "user", + "type": "SDL_UserEvent", + "comment": "Custom event data" + }, + { + "name": "tfinger", + "type": "SDL_TouchFingerEvent", + "comment": "Touch finger event data" + }, + { + "name": "pinch", + "type": "SDL_PinchFingerEvent", + "comment": "Pinch event data" + }, + { + "name": "pproximity", + "type": "SDL_PenProximityEvent", + "comment": "Pen proximity event data" + }, + { + "name": "ptouch", + "type": "SDL_PenTouchEvent", + "comment": "Pen tip touching event data" + }, + { + "name": "pmotion", + "type": "SDL_PenMotionEvent", + "comment": "Pen motion event data" + }, + { + "name": "pbutton", + "type": "SDL_PenButtonEvent", + "comment": "Pen button event data" + }, + { + "name": "paxis", + "type": "SDL_PenAxisEvent", + "comment": "Pen axis event data" + }, + { + "name": "render", + "type": "SDL_RenderEvent", + "comment": "Render event data" + }, + { + "name": "drop", + "type": "SDL_DropEvent", + "comment": "Drag and drop event data" + }, + { + "name": "clipboard", + "type": "SDL_ClipboardEvent", + "comment": "Clipboard event data" + }, + { + "name": "padding", + "type": "Uint8[128]" + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_PumpEvents", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_PeepEvents", + "return_type": "int", + "parameters": [ + { + "name": "events", + "type": "SDL_Event *" + }, + { + "name": "numevents", + "type": "int" + }, + { + "name": "action", + "type": "SDL_EventAction" + }, + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvent", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_HasEvents", + "return_type": "bool", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvent", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FlushEvents", + "return_type": "void", + "parameters": [ + { + "name": "minType", + "type": "Uint32" + }, + { + "name": "maxType", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PollEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_WaitEventTimeout", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + }, + { + "name": "timeoutMS", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_PushEvent", + "return_type": "bool", + "parameters": [ + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetEventFilter", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetEventFilter", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter *" + }, + { + "name": "userdata", + "type": "void **" + } + ] + }, + { + "name": "SDL_AddEventWatch", + "return_type": "bool", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveEventWatch", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_FilterEvents", + "return_type": "void", + "parameters": [ + { + "name": "filter", + "type": "SDL_EventFilter" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetEventEnabled", + "return_type": "void", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_EventEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "_type", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RegisterEvents", + "return_type": "Uint32", + "parameters": [ + { + "name": "numevents", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowFromEvent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + } + ] + }, + { + "name": "SDL_GetEventDescription", + "return_type": "int", + "parameters": [ + { + "name": "event", + "type": "const SDL_Event *" + }, + { + "name": "buf", + "type": "char *" + }, + { + "name": "buflen", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/filesystem.json b/official/release-3.4.8/json/filesystem.json new file mode 100644 index 0000000..37e102f --- /dev/null +++ b/official/release-3.4.8/json/filesystem.json @@ -0,0 +1,287 @@ +{ + "header": "SDL_filesystem.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EnumerateDirectoryCallback" + } + ], + "enums": [ + { + "name": "SDL_Folder", + "values": [ + { + "name": "SDL_FOLDER_HOME", + "comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents." + }, + { + "name": "SDL_FOLDER_DESKTOP", + "comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons." + }, + { + "name": "SDL_FOLDER_DOCUMENTS", + "comment": "User document files, possibly application-specific. This is a good place to save a user's projects." + }, + { + "name": "SDL_FOLDER_DOWNLOADS", + "comment": "Standard folder for user files downloaded from the internet." + }, + { + "name": "SDL_FOLDER_MUSIC", + "comment": "Music files that can be played using a standard music player (mp3, ogg...)." + }, + { + "name": "SDL_FOLDER_PICTURES", + "comment": "Image files that can be displayed using a standard viewer (png, jpg...)." + }, + { + "name": "SDL_FOLDER_PUBLICSHARE", + "comment": "Files that are meant to be shared with other users on the same computer." + }, + { + "name": "SDL_FOLDER_SAVEDGAMES", + "comment": "Save files for games." + }, + { + "name": "SDL_FOLDER_SCREENSHOTS", + "comment": "Application screenshots." + }, + { + "name": "SDL_FOLDER_TEMPLATES", + "comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file." + }, + { + "name": "SDL_FOLDER_VIDEOS", + "comment": "Video files that can be played using a standard video player (mp4, webm...)." + }, + { + "name": "SDL_FOLDER_COUNT", + "comment": "Total number of types in this enum, not a folder type by itself." + } + ] + }, + { + "name": "SDL_PathType", + "values": [ + { + "name": "SDL_PATHTYPE_NONE", + "comment": "path does not exist" + }, + { + "name": "SDL_PATHTYPE_FILE", + "comment": "a normal file" + }, + { + "name": "SDL_PATHTYPE_DIRECTORY", + "comment": "a directory" + }, + { + "name": "SDL_PATHTYPE_OTHER", + "comment": "something completely different like a device node (not a symlink, those are always followed)" + } + ] + }, + { + "name": "SDL_EnumerationResult", + "values": [ + { + "name": "SDL_ENUM_CONTINUE", + "comment": "Value that requests that enumeration continue." + }, + { + "name": "SDL_ENUM_SUCCESS", + "comment": "Value that requests that enumeration stop, successfully." + }, + { + "name": "SDL_ENUM_FAILURE", + "comment": "Value that requests that enumeration stop, as a failure." + } + ] + } + ], + "structs": [ + { + "name": "SDL_PathInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_PathType", + "comment": "the path type" + }, + { + "name": "size", + "type": "Uint64", + "comment": "the file size in bytes" + }, + { + "name": "create_time", + "type": "SDL_Time", + "comment": "the time when the path was created" + }, + { + "name": "modify_time", + "type": "SDL_Time", + "comment": "the last time the path was modified" + }, + { + "name": "access_time", + "type": "SDL_Time", + "comment": "the last time the path was read" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GlobFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GLOB_CASEINSENSITIVE", + "value": "(1u << 0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetBasePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetPrefPath", + "return_type": "char *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetUserFolder", + "return_type": "const char *", + "parameters": [ + { + "name": "folder", + "type": "SDL_Folder" + } + ] + }, + { + "name": "SDL_CreateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemovePath", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenamePath", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyFile", + "return_type": "bool", + "parameters": [ + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GlobDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentDirectory", + "return_type": "char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/gamepad.json b/official/release-3.4.8/json/gamepad.json new file mode 100644 index 0000000..7ffbe51 --- /dev/null +++ b/official/release-3.4.8/json/gamepad.json @@ -0,0 +1,1169 @@ +{ + "header": "SDL_gamepad.h", + "opaque_types": [ + { + "name": "SDL_Gamepad" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GamepadType", + "values": [ + { + "name": "SDL_GAMEPAD_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_TYPE_STANDARD" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOX360" + }, + { + "name": "SDL_GAMEPAD_TYPE_XBOXONE" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS3" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS4" + }, + { + "name": "SDL_GAMEPAD_TYPE_PS5" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT" + }, + { + "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" + }, + { + "name": "SDL_GAMEPAD_TYPE_GAMECUBE" + }, + { + "name": "SDL_GAMEPAD_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButton", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_BUTTON_SOUTH", + "comment": "Bottom face button (e.g. Xbox A button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_EAST", + "comment": "Right face button (e.g. Xbox B button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_WEST", + "comment": "Left face button (e.g. Xbox X button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_NORTH", + "comment": "Top face button (e.g. Xbox Y button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_BACK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_GUIDE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_START" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_STICK" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_UP" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_DOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_LEFT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_DPAD_RIGHT" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC1", + "comment": "Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", + "comment": "PS4/PS5 touchpad button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC2", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC3", + "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC4", + "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC5", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_MISC6", + "comment": "Additional button" + }, + { + "name": "SDL_GAMEPAD_BUTTON_COUNT" + } + ] + }, + { + "name": "SDL_GamepadButtonLabel", + "values": [ + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_A" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_B" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_X" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_Y" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CROSS" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_CIRCLE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_SQUARE" + }, + { + "name": "SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE" + } + ] + }, + { + "name": "SDL_GamepadAxis", + "values": [ + { + "name": "SDL_GAMEPAD_AXIS_INVALID", + "value": "-1" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTX" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHTY" + }, + { + "name": "SDL_GAMEPAD_AXIS_LEFT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_RIGHT_TRIGGER" + }, + { + "name": "SDL_GAMEPAD_AXIS_COUNT" + } + ] + }, + { + "name": "SDL_GamepadBindingType", + "values": [ + { + "name": "SDL_GAMEPAD_BINDTYPE_NONE", + "value": "0" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_BUTTON" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_AXIS" + }, + { + "name": "SDL_GAMEPAD_BINDTYPE_HAT" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GamepadBinding", + "fields": [ + { + "name": "input_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "hat_mask", + "type": "int" + }, + { + "name": "output_type", + "type": "SDL_GamepadBindingType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + }, + { + "name": "axis_min", + "type": "int" + }, + { + "name": "axis_max", + "type": "int" + } + ], + "has_unions": true + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_AddGamepadMapping", + "return_type": "int", + "parameters": [ + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromIO", + "return_type": "int", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddGamepadMappingsFromFile", + "return_type": "int", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ReloadGamepadMappings", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadMappings", + "return_type": "char **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForGUID", + "return_type": "char *", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + } + ] + }, + { + "name": "SDL_GetGamepadMapping", + "return_type": "char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadMapping", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + }, + { + "name": "mapping", + "type": "const char *" + } + ] + }, + { + "name": "SDL_HasGamepad", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepads", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_IsGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetRealGamepadTypeForID", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadMappingForID", + "return_type": "char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenGamepad", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromID", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetGamepadFromPlayerIndex", + "return_type": "SDL_Gamepad *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadName", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPath", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetRealGamepadType", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadSteamHandle", + "return_type": "Uint64", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "percent", + "type": "int *" + } + ] + }, + { + "name": "SDL_GamepadConnected", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_SetGamepadEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetGamepadBindings", + "return_type": "SDL_GamepadBinding **", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateGamepads", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGamepadTypeFromString", + "return_type": "SDL_GamepadType", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForType", + "return_type": "const char *", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + } + ] + }, + { + "name": "SDL_GetGamepadAxisFromString", + "return_type": "SDL_GamepadAxis", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GamepadHasAxis", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + }, + { + "name": "SDL_GetGamepadButtonFromString", + "return_type": "SDL_GamepadButton", + "parameters": [ + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetGamepadStringForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GamepadHasButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButton", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabelForType", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "_type", + "type": "SDL_GamepadType" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadButtonLabel", + "return_type": "SDL_GamepadButtonLabel", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpads", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetNumGamepadTouchpadFingers", + "return_type": "int", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGamepadTouchpadFinger", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool *" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + }, + { + "name": "pressure", + "type": "float *" + } + ] + }, + { + "name": "SDL_GamepadHasSensor", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_SetGamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GamepadSensorEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorDataRate", + "return_type": "float", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + } + ] + }, + { + "name": "SDL_GetGamepadSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleGamepad", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleGamepadTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGamepadLED", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendGamepadEffect", + "return_type": "bool", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseGamepad", + "return_type": "void", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForButton", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "button", + "type": "SDL_GamepadButton" + } + ] + }, + { + "name": "SDL_GetGamepadAppleSFSymbolsNameForAxis", + "return_type": "const char *", + "parameters": [ + { + "name": "gamepad", + "type": "SDL_Gamepad *" + }, + { + "name": "axis", + "type": "SDL_GamepadAxis" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/gpu.json b/official/release-3.4.8/json/gpu.json new file mode 100644 index 0000000..514880a --- /dev/null +++ b/official/release-3.4.8/json/gpu.json @@ -0,0 +1,3988 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + { + "name": "SDL_GPUDevice" + }, + { + "name": "SDL_GPUBuffer" + }, + { + "name": "SDL_GPUTransferBuffer" + }, + { + "name": "SDL_GPUTexture" + }, + { + "name": "SDL_GPUSampler" + }, + { + "name": "SDL_GPUShader" + }, + { + "name": "SDL_GPUComputePipeline" + }, + { + "name": "SDL_GPUGraphicsPipeline" + }, + { + "name": "SDL_GPUCommandBuffer" + }, + { + "name": "SDL_GPURenderPass" + }, + { + "name": "SDL_GPUComputePass" + }, + { + "name": "SDL_GPUCopyPass" + }, + { + "name": "SDL_GPUFence" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_GPUPrimitiveType", + "values": [ + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLELIST", + "comment": "A series of separate triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP", + "comment": "A series of connected triangles." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINELIST", + "comment": "A series of separate lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_LINESTRIP", + "comment": "A series of connected lines." + }, + { + "name": "SDL_GPU_PRIMITIVETYPE_POINTLIST", + "comment": "A series of separate points." + } + ] + }, + { + "name": "SDL_GPULoadOp", + "values": [ + { + "name": "SDL_GPU_LOADOP_LOAD", + "comment": "The previous contents of the texture will be preserved." + }, + { + "name": "SDL_GPU_LOADOP_CLEAR", + "comment": "The contents of the texture will be cleared to a color." + }, + { + "name": "SDL_GPU_LOADOP_DONT_CARE", + "comment": "The previous contents of the texture need not be preserved. The contents will be undefined." + } + ] + }, + { + "name": "SDL_GPUStoreOp", + "values": [ + { + "name": "SDL_GPU_STOREOP_STORE", + "comment": "The contents generated during the render pass will be written to memory." + }, + { + "name": "SDL_GPU_STOREOP_DONT_CARE", + "comment": "The contents generated during the render pass are not needed and may be discarded. The contents will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined." + }, + { + "name": "SDL_GPU_STOREOP_RESOLVE_AND_STORE", + "comment": "The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory." + } + ] + }, + { + "name": "SDL_GPUIndexElementSize", + "values": [ + { + "name": "SDL_GPU_INDEXELEMENTSIZE_16BIT", + "comment": "The index elements are 16-bit." + }, + { + "name": "SDL_GPU_INDEXELEMENTSIZE_32BIT", + "comment": "The index elements are 32-bit." + } + ] + }, + { + "name": "SDL_GPUTextureFormat", + "values": [ + { + "name": "SDL_GPU_TEXTUREFORMAT_INVALID" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT" + }, + { + "name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT" + } + ] + }, + { + "name": "SDL_GPUTextureType", + "values": [ + { + "name": "SDL_GPU_TEXTURETYPE_2D", + "comment": "The texture is a 2-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_2D_ARRAY", + "comment": "The texture is a 2-dimensional array image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_3D", + "comment": "The texture is a 3-dimensional image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE", + "comment": "The texture is a cube image." + }, + { + "name": "SDL_GPU_TEXTURETYPE_CUBE_ARRAY", + "comment": "The texture is a cube array image." + } + ] + }, + { + "name": "SDL_GPUSampleCount", + "values": [ + { + "name": "SDL_GPU_SAMPLECOUNT_1", + "comment": "No multisampling." + }, + { + "name": "SDL_GPU_SAMPLECOUNT_2", + "comment": "MSAA 2x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_4", + "comment": "MSAA 4x" + }, + { + "name": "SDL_GPU_SAMPLECOUNT_8", + "comment": "MSAA 8x" + } + ] + }, + { + "name": "SDL_GPUCubeMapFace", + "values": [ + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ" + }, + { + "name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ" + } + ] + }, + { + "name": "SDL_GPUTransferBufferUsage", + "values": [ + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD" + }, + { + "name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD" + } + ] + }, + { + "name": "SDL_GPUShaderStage", + "values": [ + { + "name": "SDL_GPU_SHADERSTAGE_VERTEX" + }, + { + "name": "SDL_GPU_SHADERSTAGE_FRAGMENT" + } + ] + }, + { + "name": "SDL_GPUVertexElementFormat", + "values": [ + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2" + }, + { + "name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4" + } + ] + }, + { + "name": "SDL_GPUVertexInputRate", + "values": [ + { + "name": "SDL_GPU_VERTEXINPUTRATE_VERTEX", + "comment": "Attribute addressing is a function of the vertex index." + }, + { + "name": "SDL_GPU_VERTEXINPUTRATE_INSTANCE", + "comment": "Attribute addressing is a function of the instance index." + } + ] + }, + { + "name": "SDL_GPUFillMode", + "values": [ + { + "name": "SDL_GPU_FILLMODE_FILL", + "comment": "Polygons will be rendered via rasterization." + }, + { + "name": "SDL_GPU_FILLMODE_LINE", + "comment": "Polygon edges will be drawn as line segments." + } + ] + }, + { + "name": "SDL_GPUCullMode", + "values": [ + { + "name": "SDL_GPU_CULLMODE_NONE", + "comment": "No triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_FRONT", + "comment": "Front-facing triangles are culled." + }, + { + "name": "SDL_GPU_CULLMODE_BACK", + "comment": "Back-facing triangles are culled." + } + ] + }, + { + "name": "SDL_GPUFrontFace", + "values": [ + { + "name": "SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE", + "comment": "A triangle with counter-clockwise vertex winding will be considered front-facing." + }, + { + "name": "SDL_GPU_FRONTFACE_CLOCKWISE", + "comment": "A triangle with clockwise vertex winding will be considered front-facing." + } + ] + }, + { + "name": "SDL_GPUCompareOp", + "values": [ + { + "name": "SDL_GPU_COMPAREOP_INVALID" + }, + { + "name": "SDL_GPU_COMPAREOP_NEVER", + "comment": "The comparison always evaluates false." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS", + "comment": "The comparison evaluates reference < test." + }, + { + "name": "SDL_GPU_COMPAREOP_EQUAL", + "comment": "The comparison evaluates reference == test." + }, + { + "name": "SDL_GPU_COMPAREOP_LESS_OR_EQUAL", + "comment": "The comparison evaluates reference <= test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER", + "comment": "The comparison evaluates reference > test." + }, + { + "name": "SDL_GPU_COMPAREOP_NOT_EQUAL", + "comment": "The comparison evaluates reference != test." + }, + { + "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", + "comment": "The comparison evaluates reference >= test." + }, + { + "name": "SDL_GPU_COMPAREOP_ALWAYS", + "comment": "The comparison always evaluates true." + } + ] + }, + { + "name": "SDL_GPUStencilOp", + "values": [ + { + "name": "SDL_GPU_STENCILOP_INVALID" + }, + { + "name": "SDL_GPU_STENCILOP_KEEP", + "comment": "Keeps the current value." + }, + { + "name": "SDL_GPU_STENCILOP_ZERO", + "comment": "Sets the value to 0." + }, + { + "name": "SDL_GPU_STENCILOP_REPLACE", + "comment": "Sets the value to reference." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP", + "comment": "Increments the current value and clamps to the maximum value." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP", + "comment": "Decrements the current value and clamps to 0." + }, + { + "name": "SDL_GPU_STENCILOP_INVERT", + "comment": "Bitwise-inverts the current value." + }, + { + "name": "SDL_GPU_STENCILOP_INCREMENT_AND_WRAP", + "comment": "Increments the current value and wraps back to 0." + }, + { + "name": "SDL_GPU_STENCILOP_DECREMENT_AND_WRAP", + "comment": "Decrements the current value and wraps to the maximum value." + } + ] + }, + { + "name": "SDL_GPUBlendOp", + "values": [ + { + "name": "SDL_GPU_BLENDOP_INVALID" + }, + { + "name": "SDL_GPU_BLENDOP_ADD", + "comment": "(source * source_factor) + (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_SUBTRACT", + "comment": "(source * source_factor) - (destination * destination_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_REVERSE_SUBTRACT", + "comment": "(destination * destination_factor) - (source * source_factor)" + }, + { + "name": "SDL_GPU_BLENDOP_MIN", + "comment": "min(source, destination)" + }, + { + "name": "SDL_GPU_BLENDOP_MAX", + "comment": "max(source, destination)" + } + ] + }, + { + "name": "SDL_GPUBlendFactor", + "values": [ + { + "name": "SDL_GPU_BLENDFACTOR_INVALID" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ZERO", + "comment": "0" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE", + "comment": "1" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_COLOR", + "comment": "source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR", + "comment": "1 - source color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_COLOR", + "comment": "destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR", + "comment": "1 - destination color" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA", + "comment": "source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA", + "comment": "1 - source alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_DST_ALPHA", + "comment": "destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA", + "comment": "1 - destination alpha" + }, + { + "name": "SDL_GPU_BLENDFACTOR_CONSTANT_COLOR", + "comment": "blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR", + "comment": "1 - blend constant" + }, + { + "name": "SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE", + "comment": "min(source alpha, 1 - destination alpha)" + } + ] + }, + { + "name": "SDL_GPUFilter", + "values": [ + { + "name": "SDL_GPU_FILTER_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_FILTER_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerMipmapMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_NEAREST", + "comment": "Point filtering." + }, + { + "name": "SDL_GPU_SAMPLERMIPMAPMODE_LINEAR", + "comment": "Linear filtering." + } + ] + }, + { + "name": "SDL_GPUSamplerAddressMode", + "values": [ + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_REPEAT", + "comment": "Specifies that the coordinates will wrap around." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT", + "comment": "Specifies that the coordinates will wrap around mirrored." + }, + { + "name": "SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE", + "comment": "Specifies that the coordinates will clamp to the 0-1 range." + } + ] + }, + { + "name": "SDL_GPUPresentMode", + "values": [ + { + "name": "SDL_GPU_PRESENTMODE_VSYNC" + }, + { + "name": "SDL_GPU_PRESENTMODE_IMMEDIATE" + }, + { + "name": "SDL_GPU_PRESENTMODE_MAILBOX" + } + ] + }, + { + "name": "SDL_GPUSwapchainComposition", + "values": [ + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR" + }, + { + "name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084" + } + ] + } + ], + "structs": [ + { + "name": "SDL_GPUViewport", + "fields": [ + { + "name": "x", + "type": "float", + "comment": "The left offset of the viewport." + }, + { + "name": "y", + "type": "float", + "comment": "The top offset of the viewport." + }, + { + "name": "w", + "type": "float", + "comment": "The width of the viewport." + }, + { + "name": "h", + "type": "float", + "comment": "The height of the viewport." + }, + { + "name": "min_depth", + "type": "float", + "comment": "The minimum depth of the viewport." + }, + { + "name": "max_depth", + "type": "float", + "comment": "The maximum depth of the viewport." + } + ] + }, + { + "name": "SDL_GPUTextureTransferInfo", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the image data in the transfer buffer." + }, + { + "name": "pixels_per_row", + "type": "Uint32", + "comment": "The number of pixels from one row to the next." + }, + { + "name": "rows_per_layer", + "type": "Uint32", + "comment": "The number of rows from one layer/depth-slice to the next." + } + ] + }, + { + "name": "SDL_GPUTransferBufferLocation", + "fields": [ + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *", + "comment": "The transfer buffer used in the transfer operation." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the buffer data in the transfer buffer." + } + ] + }, + { + "name": "SDL_GPUTextureLocation", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the location." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index of the location." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the location." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the location." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the location." + } + ] + }, + { + "name": "SDL_GPUTextureRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture used in the copy operation." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to transfer." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to transfer." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "z", + "type": "Uint32", + "comment": "The front offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + }, + { + "name": "d", + "type": "Uint32", + "comment": "The depth of the region." + } + ] + }, + { + "name": "SDL_GPUBlitRegion", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index of the region." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "x", + "type": "Uint32", + "comment": "The left offset of the region." + }, + { + "name": "y", + "type": "Uint32", + "comment": "The top offset of the region." + }, + { + "name": "w", + "type": "Uint32", + "comment": "The width of the region." + }, + { + "name": "h", + "type": "Uint32", + "comment": "The height of the region." + } + ] + }, + { + "name": "SDL_GPUBufferLocation", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + } + ] + }, + { + "name": "SDL_GPUBufferRegion", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte within the buffer." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the region." + } + ] + }, + { + "name": "SDL_GPUIndirectDrawCommand", + "fields": [ + { + "name": "num_vertices", + "type": "Uint32", + "comment": "The number of vertices to draw." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_vertex", + "type": "Uint32", + "comment": "The index of the first vertex to draw." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndexedIndirectDrawCommand", + "fields": [ + { + "name": "num_indices", + "type": "Uint32", + "comment": "The number of indices to draw per instance." + }, + { + "name": "num_instances", + "type": "Uint32", + "comment": "The number of instances to draw." + }, + { + "name": "first_index", + "type": "Uint32", + "comment": "The base index within the index buffer." + }, + { + "name": "vertex_offset", + "type": "Sint32", + "comment": "The value added to the vertex index before indexing into the vertex buffer." + }, + { + "name": "first_instance", + "type": "Uint32", + "comment": "The ID of the first instance to draw." + } + ] + }, + { + "name": "SDL_GPUIndirectDispatchCommand", + "fields": [ + { + "name": "groupcount_x", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the X dimension." + }, + { + "name": "groupcount_y", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Y dimension." + }, + { + "name": "groupcount_z", + "type": "Uint32", + "comment": "The number of local workgroups to dispatch in the Z dimension." + } + ] + }, + { + "name": "SDL_GPUSamplerCreateInfo", + "fields": [ + { + "name": "min_filter", + "type": "SDL_GPUFilter", + "comment": "The minification filter to apply to lookups." + }, + { + "name": "mag_filter", + "type": "SDL_GPUFilter", + "comment": "The magnification filter to apply to lookups." + }, + { + "name": "mipmap_mode", + "type": "SDL_GPUSamplerMipmapMode", + "comment": "The mipmap filter to apply to lookups." + }, + { + "name": "address_mode_u", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for U coordinates outside [0, 1)." + }, + { + "name": "address_mode_v", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for V coordinates outside [0, 1)." + }, + { + "name": "address_mode_w", + "type": "SDL_GPUSamplerAddressMode", + "comment": "The addressing mode for W coordinates outside [0, 1)." + }, + { + "name": "mip_lod_bias", + "type": "float", + "comment": "The bias to be added to mipmap LOD calculation." + }, + { + "name": "max_anisotropy", + "type": "float", + "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator to apply to fetched data before filtering." + }, + { + "name": "min_lod", + "type": "float", + "comment": "Clamps the minimum of the computed LOD value." + }, + { + "name": "max_lod", + "type": "float", + "comment": "Clamps the maximum of the computed LOD value." + }, + { + "name": "enable_anisotropy", + "type": "bool", + "comment": "true to enable anisotropic filtering." + }, + { + "name": "enable_compare", + "type": "bool", + "comment": "true to enable comparison against a reference value during lookups." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUVertexBufferDescription", + "fields": [ + { + "name": "slot", + "type": "Uint32", + "comment": "The binding slot of the vertex buffer." + }, + { + "name": "pitch", + "type": "Uint32", + "comment": "The size of a single element + the offset between elements." + }, + { + "name": "input_rate", + "type": "SDL_GPUVertexInputRate", + "comment": "Whether attribute addressing is a function of the vertex index or instance index." + }, + { + "name": "instance_step_rate", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + } + ] + }, + { + "name": "SDL_GPUVertexAttribute", + "fields": [ + { + "name": "location", + "type": "Uint32", + "comment": "The shader input location index." + }, + { + "name": "buffer_slot", + "type": "Uint32", + "comment": "The binding slot of the associated vertex buffer." + }, + { + "name": "format", + "type": "SDL_GPUVertexElementFormat", + "comment": "The size and type of the attribute data." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The byte offset of this attribute relative to the start of the vertex element." + } + ] + }, + { + "name": "SDL_GPUVertexInputState", + "fields": [ + { + "name": "vertex_buffer_descriptions", + "type": "const SDL_GPUVertexBufferDescription *", + "comment": "A pointer to an array of vertex buffer descriptions." + }, + { + "name": "num_vertex_buffers", + "type": "Uint32", + "comment": "The number of vertex buffer descriptions in the above array." + }, + { + "name": "vertex_attributes", + "type": "const SDL_GPUVertexAttribute *", + "comment": "A pointer to an array of vertex attribute descriptions." + }, + { + "name": "num_vertex_attributes", + "type": "Uint32", + "comment": "The number of vertex attribute descriptions in the above array." + } + ] + }, + { + "name": "SDL_GPUStencilOpState", + "fields": [ + { + "name": "fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that fail the stencil test." + }, + { + "name": "pass_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the depth and stencil tests." + }, + { + "name": "depth_fail_op", + "type": "SDL_GPUStencilOp", + "comment": "The action performed on samples that pass the stencil test and fail the depth test." + }, + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used in the stencil test." + } + ] + }, + { + "name": "SDL_GPUColorTargetBlendState", + "fields": [ + { + "name": "src_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source RGB value." + }, + { + "name": "dst_color_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination RGB value." + }, + { + "name": "color_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the RGB components." + }, + { + "name": "src_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the source alpha." + }, + { + "name": "dst_alpha_blendfactor", + "type": "SDL_GPUBlendFactor", + "comment": "The value to be multiplied by the destination alpha." + }, + { + "name": "alpha_blend_op", + "type": "SDL_GPUBlendOp", + "comment": "The blend operation for the alpha component." + }, + { + "name": "color_write_mask", + "type": "SDL_GPUColorComponentFlags", + "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false." + }, + { + "name": "enable_blend", + "type": "bool", + "comment": "Whether blending is enabled for the color target." + }, + { + "name": "enable_color_write_mask", + "type": "bool", + "comment": "Whether the color write mask is enabled." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUShaderCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the shader code." + }, + { + "name": "stage", + "type": "SDL_GPUShaderStage", + "comment": "The stage the shader program corresponds to." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_storage_textures", + "type": "Uint32", + "comment": "The number of storage textures defined in the shader." + }, + { + "name": "num_storage_buffers", + "type": "Uint32", + "comment": "The number of storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTextureCreateInfo", + "fields": [ + { + "name": "_type", + "type": "SDL_GPUTextureType", + "comment": "The base dimensionality of the texture." + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture." + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags", + "comment": "How the texture is intended to be used by the client." + }, + { + "name": "width", + "type": "Uint32", + "comment": "The width of the texture." + }, + { + "name": "height", + "type": "Uint32", + "comment": "The height of the texture." + }, + { + "name": "layer_count_or_depth", + "type": "Uint32", + "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures." + }, + { + "name": "num_levels", + "type": "Uint32", + "comment": "The number of mip levels in the texture." + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples per texel. Only applies if the texture is used as a render target." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUBufferUsageFlags", + "comment": "How the buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUTransferBufferCreateInfo", + "fields": [ + { + "name": "usage", + "type": "SDL_GPUTransferBufferUsage", + "comment": "How the transfer buffer is intended to be used by the client." + }, + { + "name": "size", + "type": "Uint32", + "comment": "The size in bytes of the transfer buffer." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPURasterizerState", + "fields": [ + { + "name": "fill_mode", + "type": "SDL_GPUFillMode", + "comment": "Whether polygons will be filled in or drawn as lines." + }, + { + "name": "cull_mode", + "type": "SDL_GPUCullMode", + "comment": "The facing direction in which triangles will be culled." + }, + { + "name": "front_face", + "type": "SDL_GPUFrontFace", + "comment": "The vertex winding that will cause a triangle to be determined as front-facing." + }, + { + "name": "depth_bias_constant_factor", + "type": "float", + "comment": "A scalar factor controlling the depth value added to each fragment." + }, + { + "name": "depth_bias_clamp", + "type": "float", + "comment": "The maximum depth bias of a fragment." + }, + { + "name": "depth_bias_slope_factor", + "type": "float", + "comment": "A scalar factor applied to a fragment's slope in depth calculations." + }, + { + "name": "enable_depth_bias", + "type": "bool", + "comment": "true to bias fragment depth values." + }, + { + "name": "enable_depth_clip", + "type": "bool", + "comment": "true to enable depth clip, false to enable depth clamp." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUMultisampleState", + "fields": [ + { + "name": "sample_count", + "type": "SDL_GPUSampleCount", + "comment": "The number of samples to be used in rasterization." + }, + { + "name": "sample_mask", + "type": "Uint32", + "comment": "Reserved for future use. Must be set to 0." + }, + { + "name": "enable_mask", + "type": "bool", + "comment": "Reserved for future use. Must be set to false." + }, + { + "name": "enable_alpha_to_coverage", + "type": "bool", + "comment": "true enables the alpha-to-coverage feature." + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilState", + "fields": [ + { + "name": "compare_op", + "type": "SDL_GPUCompareOp", + "comment": "The comparison operator used for depth testing." + }, + { + "name": "back_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for back-facing triangles." + }, + { + "name": "front_stencil_state", + "type": "SDL_GPUStencilOpState", + "comment": "The stencil op state for front-facing triangles." + }, + { + "name": "compare_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values participating in the stencil test." + }, + { + "name": "write_mask", + "type": "Uint8", + "comment": "Selects the bits of the stencil values updated by the stencil test." + }, + { + "name": "enable_depth_test", + "type": "bool", + "comment": "true enables the depth test." + }, + { + "name": "enable_depth_write", + "type": "bool", + "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false." + }, + { + "name": "enable_stencil_test", + "type": "bool", + "comment": "true enables the stencil test." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUColorTargetDescription", + "fields": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the texture to be used as a color target." + }, + { + "name": "blend_state", + "type": "SDL_GPUColorTargetBlendState", + "comment": "The blend state to be used for the color target." + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineTargetInfo", + "fields": [ + { + "name": "color_target_descriptions", + "type": "const SDL_GPUColorTargetDescription *", + "comment": "A pointer to an array of color target descriptions." + }, + { + "name": "num_color_targets", + "type": "Uint32", + "comment": "The number of color target descriptions in the above array." + }, + { + "name": "depth_stencil_format", + "type": "SDL_GPUTextureFormat", + "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false." + }, + { + "name": "has_depth_stencil_target", + "type": "bool", + "comment": "true specifies that the pipeline uses a depth-stencil target." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUGraphicsPipelineCreateInfo", + "fields": [ + { + "name": "vertex_shader", + "type": "SDL_GPUShader *", + "comment": "The vertex shader used by the graphics pipeline." + }, + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader used by the graphics pipeline." + }, + { + "name": "vertex_input_state", + "type": "SDL_GPUVertexInputState", + "comment": "The vertex layout of the graphics pipeline." + }, + { + "name": "primitive_type", + "type": "SDL_GPUPrimitiveType", + "comment": "The primitive topology of the graphics pipeline." + }, + { + "name": "rasterizer_state", + "type": "SDL_GPURasterizerState", + "comment": "The rasterizer state of the graphics pipeline." + }, + { + "name": "multisample_state", + "type": "SDL_GPUMultisampleState", + "comment": "The multisample state of the graphics pipeline." + }, + { + "name": "depth_stencil_state", + "type": "SDL_GPUDepthStencilState", + "comment": "The depth-stencil state of the graphics pipeline." + }, + { + "name": "target_info", + "type": "SDL_GPUGraphicsPipelineTargetInfo", + "comment": "Formats and blend modes for the render targets of the graphics pipeline." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUComputePipelineCreateInfo", + "fields": [ + { + "name": "code_size", + "type": "size_t", + "comment": "The size in bytes of the compute shader code pointed to." + }, + { + "name": "code", + "type": "const Uint8 *", + "comment": "A pointer to compute shader code." + }, + { + "name": "entrypoint", + "type": "const char *", + "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader." + }, + { + "name": "format", + "type": "SDL_GPUShaderFormat", + "comment": "The format of the compute shader code." + }, + { + "name": "num_samplers", + "type": "Uint32", + "comment": "The number of samplers defined in the shader." + }, + { + "name": "num_readonly_storage_textures", + "type": "Uint32", + "comment": "The number of readonly storage textures defined in the shader." + }, + { + "name": "num_readonly_storage_buffers", + "type": "Uint32", + "comment": "The number of readonly storage buffers defined in the shader." + }, + { + "name": "num_readwrite_storage_textures", + "type": "Uint32", + "comment": "The number of read-write storage textures defined in the shader." + }, + { + "name": "num_readwrite_storage_buffers", + "type": "Uint32", + "comment": "The number of read-write storage buffers defined in the shader." + }, + { + "name": "num_uniform_buffers", + "type": "Uint32", + "comment": "The number of uniform buffers defined in the shader." + }, + { + "name": "threadcount_x", + "type": "Uint32", + "comment": "The number of threads in the X dimension. This should match the value in the shader." + }, + { + "name": "threadcount_y", + "type": "Uint32", + "comment": "The number of threads in the Y dimension. This should match the value in the shader." + }, + { + "name": "threadcount_z", + "type": "Uint32", + "comment": "The number of threads in the Z dimension. This should match the value in the shader." + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + }, + { + "name": "SDL_GPUColorTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as a color target by a render pass." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level to use as a color target." + }, + { + "name": "layer_or_depth_plane", + "type": "Uint32", + "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the color target at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the results of the render pass." + }, + { + "name": "resolve_texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_mip_level", + "type": "Uint32", + "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "resolve_layer", + "type": "Uint32", + "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and load_op is not LOAD" + }, + { + "name": "cycle_resolve_texture", + "type": "bool", + "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUDepthStencilTargetInfo", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture that will be used as the depth stencil target by the render pass." + }, + { + "name": "clear_depth", + "type": "float", + "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the depth contents at the beginning of the render pass." + }, + { + "name": "store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the depth results of the render pass." + }, + { + "name": "stencil_load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the stencil contents at the beginning of the render pass." + }, + { + "name": "stencil_store_op", + "type": "SDL_GPUStoreOp", + "comment": "What is done with the stencil results of the render pass." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD" + }, + { + "name": "clear_stencil", + "type": "Uint8", + "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." + }, + { + "name": "mip_level", + "type": "Uint8", + "comment": "The mip level to use as the depth stencil target." + }, + { + "name": "layer", + "type": "Uint8", + "comment": "The layer index to use as the depth stencil target." + } + ] + }, + { + "name": "SDL_GPUBlitInfo", + "fields": [ + { + "name": "source", + "type": "SDL_GPUBlitRegion", + "comment": "The source region for the blit." + }, + { + "name": "destination", + "type": "SDL_GPUBlitRegion", + "comment": "The destination region for the blit." + }, + { + "name": "load_op", + "type": "SDL_GPULoadOp", + "comment": "What is done with the contents of the destination before the blit." + }, + { + "name": "clear_color", + "type": "SDL_FColor", + "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR." + }, + { + "name": "flip_mode", + "type": "SDL_FlipMode", + "comment": "The flip mode for the source region." + }, + { + "name": "filter", + "type": "SDL_GPUFilter", + "comment": "The filter mode used when blitting." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the destination texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUBufferBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer." + }, + { + "name": "offset", + "type": "Uint32", + "comment": "The starting byte of the data to bind in the buffer." + } + ] + }, + { + "name": "SDL_GPUTextureSamplerBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER." + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *", + "comment": "The sampler to bind." + } + ] + }, + { + "name": "SDL_GPUStorageBufferReadWriteBinding", + "fields": [ + { + "name": "buffer", + "type": "SDL_GPUBuffer *", + "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the buffer if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUStorageTextureReadWriteBinding", + "fields": [ + { + "name": "texture", + "type": "SDL_GPUTexture *", + "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE." + }, + { + "name": "mip_level", + "type": "Uint32", + "comment": "The mip level index to bind." + }, + { + "name": "layer", + "type": "Uint32", + "comment": "The layer index to bind." + }, + { + "name": "cycle", + "type": "bool", + "comment": "true cycles the texture if it is already bound." + }, + { + "name": "padding1", + "type": "Uint8" + }, + { + "name": "padding2", + "type": "Uint8" + }, + { + "name": "padding3", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GPUVulkanOptions", + "fields": [ + { + "name": "vulkan_api_version", + "type": "Uint32", + "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." + }, + { + "name": "feature_list", + "type": "void *", + "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" + }, + { + "name": "vulkan_10_physical_device_features", + "type": "void *", + "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." + }, + { + "name": "device_extension_count", + "type": "Uint32", + "comment": "Number of additional device extensions to require." + }, + { + "name": "device_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional device extensions to require." + }, + { + "name": "instance_extension_count", + "type": "Uint32", + "comment": "Number of additional instance extensions to require." + }, + { + "name": "instance_extension_names", + "type": "const char **", + "comment": "Pointer to a list of additional instance extensions to require." + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_GPUTextureUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", + "value": "(1u << 0)", + "comment": "Texture supports sampling." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", + "value": "(1u << 1)", + "comment": "Texture is a color render target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", + "value": "(1u << 2)", + "comment": "Texture is a depth stencil target." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Texture supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Texture supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Texture supports storage writes in the compute stage." + }, + { + "name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", + "value": "(1u << 6)", + "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE." + } + ] + }, + { + "name": "SDL_GPUBufferUsageFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_BUFFERUSAGE_VERTEX", + "value": "(1u << 0)", + "comment": "Buffer is a vertex buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDEX", + "value": "(1u << 1)", + "comment": "Buffer is an index buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_INDIRECT", + "value": "(1u << 2)", + "comment": "Buffer is an indirect buffer." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", + "value": "(1u << 3)", + "comment": "Buffer supports storage reads in graphics stages." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", + "value": "(1u << 4)", + "comment": "Buffer supports storage reads in the compute stage." + }, + { + "name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", + "value": "(1u << 5)", + "comment": "Buffer supports storage writes in the compute stage." + } + ] + }, + { + "name": "SDL_GPUShaderFormat", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_GPU_SHADERFORMAT_PRIVATE", + "value": "(1u << 0)", + "comment": "Shaders for NDA'd platforms." + }, + { + "name": "SDL_GPU_SHADERFORMAT_SPIRV", + "value": "(1u << 1)", + "comment": "SPIR-V shaders for Vulkan." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXBC", + "value": "(1u << 2)", + "comment": "DXBC SM5_1 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_DXIL", + "value": "(1u << 3)", + "comment": "DXIL SM6_0 shaders for D3D12." + }, + { + "name": "SDL_GPU_SHADERFORMAT_MSL", + "value": "(1u << 4)", + "comment": "MSL shaders for Metal." + }, + { + "name": "SDL_GPU_SHADERFORMAT_METALLIB", + "value": "(1u << 5)", + "comment": "Precompiled metallib shaders for Metal." + } + ] + }, + { + "name": "SDL_GPUColorComponentFlags", + "underlying_type": "Uint8", + "values": [ + { + "name": "SDL_GPU_COLORCOMPONENT_R", + "value": "(1u << 0)", + "comment": "the red component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_G", + "value": "(1u << 1)", + "comment": "the green component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_B", + "value": "(1u << 2)", + "comment": "the blue component" + }, + { + "name": "SDL_GPU_COLORCOMPONENT_A", + "value": "(1u << 3)", + "comment": "the alpha component" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GPUSupportsShaderFormats", + "return_type": "bool", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GPUSupportsProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPUDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "format_flags", + "type": "SDL_GPUShaderFormat" + }, + { + "name": "debug_mode", + "type": "bool" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateGPUDeviceWithProperties", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_DestroyGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetNumGPUDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetGPUDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetGPUDeviceDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUShaderFormats", + "return_type": "SDL_GPUShaderFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GetGPUDeviceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_CreateGPUComputePipeline", + "return_type": "SDL_GPUComputePipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUComputePipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUGraphicsPipeline", + "return_type": "SDL_GPUGraphicsPipeline *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUGraphicsPipelineCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUSampler", + "return_type": "SDL_GPUSampler *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUSamplerCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUShader", + "return_type": "SDL_GPUShader *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUShaderCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTexture", + "return_type": "SDL_GPUTexture *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTextureCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUBuffer", + "return_type": "SDL_GPUBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_CreateGPUTransferBuffer", + "return_type": "SDL_GPUTransferBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "createinfo", + "type": "const SDL_GPUTransferBufferCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPUBufferName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetGPUTextureName", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_InsertGPUDebugLabel", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "text", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PushGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_PopGPUDebugGroup", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_ReleaseGPUSampler", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "sampler", + "type": "SDL_GPUSampler *" + } + ] + }, + { + "name": "SDL_ReleaseGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_ReleaseGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_ReleaseGPUShader", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "shader", + "type": "SDL_GPUShader *" + } + ] + }, + { + "name": "SDL_ReleaseGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_AcquireGPUCommandBuffer", + "return_type": "SDL_GPUCommandBuffer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_PushGPUVertexUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUFragmentUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_PushGPUComputeUniformData", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BeginGPURenderPass", + "return_type": "SDL_GPURenderPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "color_target_infos", + "type": "const SDL_GPUColorTargetInfo *" + }, + { + "name": "num_color_targets", + "type": "Uint32" + }, + { + "name": "depth_stencil_target_info", + "type": "const SDL_GPUDepthStencilTargetInfo *" + } + ] + }, + { + "name": "SDL_BindGPUGraphicsPipeline", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "graphics_pipeline", + "type": "SDL_GPUGraphicsPipeline *" + } + ] + }, + { + "name": "SDL_SetGPUViewport", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "viewport", + "type": "const SDL_GPUViewport *" + } + ] + }, + { + "name": "SDL_SetGPUScissor", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "scissor", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetGPUBlendConstants", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "blend_constants", + "type": "SDL_FColor" + } + ] + }, + { + "name": "SDL_SetGPUStencilReference", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "reference", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_BindGPUVertexBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "bindings", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUIndexBuffer", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "binding", + "type": "const SDL_GPUBufferBinding *" + }, + { + "name": "index_element_size", + "type": "SDL_GPUIndexElementSize" + } + ] + }, + { + "name": "SDL_BindGPUVertexSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUVertexStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentSamplers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUFragmentStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_indices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_index", + "type": "Uint32" + }, + { + "name": "vertex_offset", + "type": "Sint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitives", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "num_vertices", + "type": "Uint32" + }, + { + "name": "num_instances", + "type": "Uint32" + }, + { + "name": "first_vertex", + "type": "Uint32" + }, + { + "name": "first_instance", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DrawGPUIndexedPrimitivesIndirect", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + }, + { + "name": "draw_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPURenderPass", + "return_type": "void", + "parameters": [ + { + "name": "render_pass", + "type": "SDL_GPURenderPass *" + } + ] + }, + { + "name": "SDL_BeginGPUComputePass", + "return_type": "SDL_GPUComputePass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "storage_texture_bindings", + "type": "const SDL_GPUStorageTextureReadWriteBinding *" + }, + { + "name": "num_storage_texture_bindings", + "type": "Uint32" + }, + { + "name": "storage_buffer_bindings", + "type": "const SDL_GPUStorageBufferReadWriteBinding *" + }, + { + "name": "num_storage_buffer_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputePipeline", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "compute_pipeline", + "type": "SDL_GPUComputePipeline *" + } + ] + }, + { + "name": "SDL_BindGPUComputeSamplers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "texture_sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageTextures", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BindGPUComputeStorageBuffers", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "first_slot", + "type": "Uint32" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *" + }, + { + "name": "num_bindings", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUCompute", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "groupcount_x", + "type": "Uint32" + }, + { + "name": "groupcount_y", + "type": "Uint32" + }, + { + "name": "groupcount_z", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DispatchGPUComputeIndirect", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + }, + { + "name": "buffer", + "type": "SDL_GPUBuffer *" + }, + { + "name": "offset", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_EndGPUComputePass", + "return_type": "void", + "parameters": [ + { + "name": "compute_pass", + "type": "SDL_GPUComputePass *" + } + ] + }, + { + "name": "SDL_MapGPUTransferBuffer", + "return_type": "void *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UnmapGPUTransferBuffer", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "transfer_buffer", + "type": "SDL_GPUTransferBuffer *" + } + ] + }, + { + "name": "SDL_BeginGPUCopyPass", + "return_type": "SDL_GPUCopyPass *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_UploadToGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureTransferInfo *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_UploadToGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTransferBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUTextureToTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureLocation *" + }, + { + "name": "w", + "type": "Uint32" + }, + { + "name": "h", + "type": "Uint32" + }, + { + "name": "d", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_CopyGPUBufferToBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "destination", + "type": "const SDL_GPUBufferLocation *" + }, + { + "name": "size", + "type": "Uint32" + }, + { + "name": "cycle", + "type": "bool" + } + ] + }, + { + "name": "SDL_DownloadFromGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUTextureRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTextureTransferInfo *" + } + ] + }, + { + "name": "SDL_DownloadFromGPUBuffer", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + }, + { + "name": "source", + "type": "const SDL_GPUBufferRegion *" + }, + { + "name": "destination", + "type": "const SDL_GPUTransferBufferLocation *" + } + ] + }, + { + "name": "SDL_EndGPUCopyPass", + "return_type": "void", + "parameters": [ + { + "name": "copy_pass", + "type": "SDL_GPUCopyPass *" + } + ] + }, + { + "name": "SDL_GenerateMipmapsForGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "texture", + "type": "SDL_GPUTexture *" + } + ] + }, + { + "name": "SDL_BlitGPUTexture", + "return_type": "void", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "info", + "type": "const SDL_GPUBlitInfo *" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUSwapchainComposition", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + } + ] + }, + { + "name": "SDL_WindowSupportsGPUPresentMode", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_ClaimWindowForGPUDevice", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ReleaseWindowFromGPUDevice", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetGPUSwapchainParameters", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_composition", + "type": "SDL_GPUSwapchainComposition" + }, + { + "name": "present_mode", + "type": "SDL_GPUPresentMode" + } + ] + }, + { + "name": "SDL_SetGPUAllowedFramesInFlight", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "allowed_frames_in_flight", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetGPUSwapchainTextureFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_AcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_WaitForGPUSwapchain", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WaitAndAcquireGPUSwapchainTexture", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + }, + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "swapchain_texture", + "type": "SDL_GPUTexture **" + }, + { + "name": "swapchain_texture_width", + "type": "Uint32 *" + }, + { + "name": "swapchain_texture_height", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_SubmitGPUCommandBufferAndAcquireFence", + "return_type": "SDL_GPUFence *", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_CancelGPUCommandBuffer", + "return_type": "bool", + "parameters": [ + { + "name": "command_buffer", + "type": "SDL_GPUCommandBuffer *" + } + ] + }, + { + "name": "SDL_WaitForGPUIdle", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_WaitForGPUFences", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "wait_all", + "type": "bool" + }, + { + "name": "fences", + "type": "SDL_GPUFence *const *" + }, + { + "name": "num_fences", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_QueryGPUFence", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_ReleaseGPUFence", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "fence", + "type": "SDL_GPUFence *" + } + ] + }, + { + "name": "SDL_GPUTextureFormatTexelBlockSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsFormat", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "_type", + "type": "SDL_GPUTextureType" + }, + { + "name": "usage", + "type": "SDL_GPUTextureUsageFlags" + } + ] + }, + { + "name": "SDL_GPUTextureSupportsSampleCount", + "return_type": "bool", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "sample_count", + "type": "SDL_GPUSampleCount" + } + ] + }, + { + "name": "SDL_CalculateGPUTextureFormatSize", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + }, + { + "name": "width", + "type": "Uint32" + }, + { + "name": "height", + "type": "Uint32" + }, + { + "name": "depth_or_layer_count", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatFromGPUTextureFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_GPUTextureFormat" + } + ] + }, + { + "name": "SDL_GetGPUTextureFormatFromPixelFormat", + "return_type": "SDL_GPUTextureFormat", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GDKSuspendGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + }, + { + "name": "SDL_GDKResumeGPU", + "return_type": "void", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/guid.json b/official/release-3.4.8/json/guid.json new file mode 100644 index 0000000..eab7336 --- /dev/null +++ b/official/release-3.4.8/json/guid.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_guid.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_GUID", + "fields": [ + { + "name": "data", + "type": "Uint8[16]" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GUIDToString", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "pszGUID", + "type": "char *" + }, + { + "name": "cbGUID", + "type": "int" + } + ] + }, + { + "name": "SDL_StringToGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "pchGUID", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/haptic.json b/official/release-3.4.8/json/haptic.json new file mode 100644 index 0000000..83227a3 --- /dev/null +++ b/official/release-3.4.8/json/haptic.json @@ -0,0 +1,806 @@ +{ + "header": "SDL_haptic.h", + "opaque_types": [ + { + "name": "SDL_Haptic" + } + ], + "typedefs": [ + { + "name": "SDL_HapticEffectType", + "underlying_type": "Uint16" + }, + { + "name": "SDL_HapticDirectionType", + "underlying_type": "Uint8" + }, + { + "name": "SDL_HapticEffectID", + "underlying_type": "int" + }, + { + "name": "SDL_HapticID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_HapticDirection", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticDirectionType", + "comment": "The type of encoding." + }, + { + "name": "dir", + "type": "Sint32[3]", + "comment": "The encoded direction." + } + ] + }, + { + "name": "SDL_HapticConstant", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CONSTANT" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "level", + "type": "Sint16", + "comment": "Strength of the constant effect." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticPeriodic", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Period of the wave." + }, + { + "name": "magnitude", + "type": "Sint16", + "comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift." + }, + { + "name": "offset", + "type": "Sint16", + "comment": "Mean value of the wave." + }, + { + "name": "phase", + "type": "Uint16", + "comment": "Positive phase shift given by hundredth of a degree." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticCondition", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "right_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the positive side; max 0xFFFF." + }, + { + "name": "left_sat", + "type": "Uint16[3]", + "comment": "Level when joystick is to the negative side; max 0xFFFF." + }, + { + "name": "right_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the positive side." + }, + { + "name": "left_coeff", + "type": "Sint16[3]", + "comment": "How fast to increase the force towards the negative side." + }, + { + "name": "deadband", + "type": "Uint16[3]", + "comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered." + }, + { + "name": "center", + "type": "Sint16[3]", + "comment": "Position of the dead zone." + } + ] + }, + { + "name": "SDL_HapticRamp", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_RAMP" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "start", + "type": "Sint16", + "comment": "Beginning strength level." + }, + { + "name": "end", + "type": "Sint16", + "comment": "Ending strength level." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + }, + { + "name": "SDL_HapticLeftRight", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_LEFTRIGHT" + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect in milliseconds." + }, + { + "name": "large_magnitude", + "type": "Uint16", + "comment": "Control of the large controller motor." + }, + { + "name": "small_magnitude", + "type": "Uint16", + "comment": "Control of the small controller motor." + } + ] + }, + { + "name": "SDL_HapticCustom", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "SDL_HAPTIC_CUSTOM" + }, + { + "name": "direction", + "type": "SDL_HapticDirection", + "comment": "Direction of the effect." + }, + { + "name": "length", + "type": "Uint32", + "comment": "Duration of the effect." + }, + { + "name": "delay", + "type": "Uint16", + "comment": "Delay before starting the effect." + }, + { + "name": "button", + "type": "Uint16", + "comment": "Button that triggers the effect." + }, + { + "name": "interval", + "type": "Uint16", + "comment": "How soon it can be triggered again after button." + }, + { + "name": "channels", + "type": "Uint8", + "comment": "Axes to use, minimum of one." + }, + { + "name": "period", + "type": "Uint16", + "comment": "Sample periods." + }, + { + "name": "samples", + "type": "Uint16", + "comment": "Amount of samples." + }, + { + "name": "data", + "type": "Uint16 *", + "comment": "Should contain channels*samples items." + }, + { + "name": "attack_length", + "type": "Uint16", + "comment": "Duration of the attack." + }, + { + "name": "attack_level", + "type": "Uint16", + "comment": "Level at the start of the attack." + }, + { + "name": "fade_length", + "type": "Uint16", + "comment": "Duration of the fade." + }, + { + "name": "fade_level", + "type": "Uint16", + "comment": "Level at the end of the fade." + } + ] + } + ], + "unions": [ + { + "name": "SDL_HapticEffect", + "fields": [ + { + "name": "_type", + "type": "SDL_HapticEffectType", + "comment": "Effect type." + }, + { + "name": "constant", + "type": "SDL_HapticConstant", + "comment": "Constant effect." + }, + { + "name": "periodic", + "type": "SDL_HapticPeriodic", + "comment": "Periodic effect." + }, + { + "name": "condition", + "type": "SDL_HapticCondition", + "comment": "Condition effect." + }, + { + "name": "ramp", + "type": "SDL_HapticRamp", + "comment": "Ramp effect." + }, + { + "name": "leftright", + "type": "SDL_HapticLeftRight", + "comment": "Left/Right effect." + }, + { + "name": "custom", + "type": "SDL_HapticCustom", + "comment": "Custom effect." + } + ] + } + ], + "flags": [], + "functions": [ + { + "name": "SDL_GetHaptics", + "return_type": "SDL_HapticID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetHapticNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_OpenHaptic", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticFromID", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_HapticID" + } + ] + }, + { + "name": "SDL_GetHapticID", + "return_type": "SDL_HapticID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticName", + "return_type": "const char *", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_IsMouseHaptic", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_OpenHapticFromMouse", + "return_type": "SDL_Haptic *", + "parameters": [] + }, + { + "name": "SDL_IsJoystickHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_OpenHapticFromJoystick", + "return_type": "SDL_Haptic *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_CloseHaptic", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffects", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetMaxHapticEffectsPlaying", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetHapticFeatures", + "return_type": "Uint32", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_GetNumHapticAxes", + "return_type": "int", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticEffectSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_CreateHapticEffect", + "return_type": "SDL_HapticEffectID", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_UpdateHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "data", + "type": "const SDL_HapticEffect *" + } + ] + }, + { + "name": "SDL_RunHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + }, + { + "name": "iterations", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticEffect", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_DestroyHapticEffect", + "return_type": "void", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_GetHapticEffectStatus", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "effect", + "type": "SDL_HapticEffectID" + } + ] + }, + { + "name": "SDL_SetHapticGain", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "gain", + "type": "int" + } + ] + }, + { + "name": "SDL_SetHapticAutocenter", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "autocenter", + "type": "int" + } + ] + }, + { + "name": "SDL_PauseHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_ResumeHaptic", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_StopHapticEffects", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_HapticRumbleSupported", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_InitHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + }, + { + "name": "SDL_PlayHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + }, + { + "name": "strength", + "type": "float" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_StopHapticRumble", + "return_type": "bool", + "parameters": [ + { + "name": "haptic", + "type": "SDL_Haptic *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/hints.json b/official/release-3.4.8/json/hints.json new file mode 100644 index 0000000..7711635 --- /dev/null +++ b/official/release-3.4.8/json/hints.json @@ -0,0 +1,139 @@ +{ + "header": "SDL_hints.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_HintCallback" + } + ], + "enums": [ + { + "name": "SDL_HintPriority", + "values": [ + { + "name": "SDL_HINT_DEFAULT" + }, + { + "name": "SDL_HINT_NORMAL" + }, + { + "name": "SDL_HINT_OVERRIDE" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetHintWithPriority", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + }, + { + "name": "priority", + "type": "SDL_HintPriority" + } + ] + }, + { + "name": "SDL_SetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHint", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_ResetHints", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetHint", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetHintBoolean", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_AddHintCallback", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveHintCallback", + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_HintCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/init.json b/official/release-3.4.8/json/init.json new file mode 100644 index 0000000..d315e0e --- /dev/null +++ b/official/release-3.4.8/json/init.json @@ -0,0 +1,202 @@ +{ + "header": "SDL_init.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_AppInit_func" + }, + { + "name": "SDL_AppIterate_func" + }, + { + "name": "SDL_AppEvent_func" + }, + { + "name": "SDL_AppQuit_func" + }, + { + "name": "SDL_MainThreadCallback" + } + ], + "enums": [ + { + "name": "SDL_AppResult", + "values": [ + { + "name": "SDL_APP_CONTINUE", + "comment": "Value that requests that the app continue from the main callbacks." + }, + { + "name": "SDL_APP_SUCCESS", + "comment": "Value that requests termination with success from the main callbacks." + }, + { + "name": "SDL_APP_FAILURE", + "comment": "Value that requests termination with error from the main callbacks." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_InitFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_INIT_AUDIO", + "value": "(1u << 4)", + "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_VIDEO", + "value": "(1u << 5)", + "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread" + }, + { + "name": "SDL_INIT_JOYSTICK", + "value": "(1u << 9)", + "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_HAPTIC", + "value": "(1u << 12)" + }, + { + "name": "SDL_INIT_GAMEPAD", + "value": "(1u << 13)", + "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`" + }, + { + "name": "SDL_INIT_EVENTS", + "value": "(1u << 14)" + }, + { + "name": "SDL_INIT_SENSOR", + "value": "(1u << 15)", + "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`" + }, + { + "name": "SDL_INIT_CAMERA", + "value": "(1u << 16)", + "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`" + } + ] + } + ], + "functions": [ + { + "name": "SDL_Init", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_InitSubSystem", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_QuitSubSystem", + "return_type": "void", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_WasInit", + "return_type": "SDL_InitFlags", + "parameters": [ + { + "name": "flags", + "type": "SDL_InitFlags" + } + ] + }, + { + "name": "SDL_Quit", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_IsMainThread", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_RunOnMainThread", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MainThreadCallback" + }, + { + "name": "userdata", + "type": "void *" + }, + { + "name": "wait_complete", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetAppMetadata", + "return_type": "bool", + "parameters": [ + { + "name": "appname", + "type": "const char *" + }, + { + "name": "appversion", + "type": "const char *" + }, + { + "name": "appidentifier", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetAppMetadataProperty", + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetAppMetadataProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/iostream.json b/official/release-3.4.8/json/iostream.json new file mode 100644 index 0000000..daee9f2 --- /dev/null +++ b/official/release-3.4.8/json/iostream.json @@ -0,0 +1,737 @@ +{ + "header": "SDL_iostream.h", + "opaque_types": [ + { + "name": "SDL_IOStream" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_IOStatus", + "values": [ + { + "name": "SDL_IO_STATUS_READY", + "comment": "Everything is ready (no errors and not EOF)." + }, + { + "name": "SDL_IO_STATUS_ERROR", + "comment": "Read or write I/O error" + }, + { + "name": "SDL_IO_STATUS_EOF", + "comment": "End of file" + }, + { + "name": "SDL_IO_STATUS_NOT_READY", + "comment": "Non blocking I/O, not ready" + }, + { + "name": "SDL_IO_STATUS_READONLY", + "comment": "Tried to write a read-only buffer" + }, + { + "name": "SDL_IO_STATUS_WRITEONLY", + "comment": "Tried to read a write-only buffer" + } + ] + }, + { + "name": "SDL_IOWhence", + "values": [ + { + "name": "SDL_IO_SEEK_SET", + "comment": "Seek from the beginning of data" + }, + { + "name": "SDL_IO_SEEK_CUR", + "comment": "Seek relative to current read point" + }, + { + "name": "SDL_IO_SEEK_END", + "comment": "Seek relative to the end of data" + } + ] + } + ], + "structs": [ + { + "name": "SDL_IOStreamInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "size", + "type": "Sint64 (SDLCALL *size)(void *userdata)" + }, + { + "name": "seek", + "type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence whence)" + }, + { + "name": "read", + "type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "write", + "type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)" + }, + { + "name": "flush", + "type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status)" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_IOFromFile", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "mode", + "type": "const char *" + } + ] + }, + { + "name": "SDL_IOFromMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromConstMem", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "mem", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_IOFromDynamicMem", + "return_type": "SDL_IOStream *", + "parameters": [] + }, + { + "name": "SDL_OpenIO", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_IOStreamInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOStatus", + "return_type": "SDL_IOStatus", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_GetIOSize", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_SeekIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "offset", + "type": "Sint64" + }, + { + "name": "whence", + "type": "SDL_IOWhence" + } + ] + }, + { + "name": "SDL_TellIO", + "return_type": "Sint64", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_ReadIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_WriteIO", + "return_type": "size_t", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + }, + { + "name": "ptr", + "type": "const void *" + }, + { + "name": "size", + "type": "size_t" + } + ] + }, + { + "name": "SDL_FlushIO", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_IOStream *" + } + ] + }, + { + "name": "SDL_LoadFile_IO", + "return_type": "void *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadFile", + "return_type": "void *", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "datasize", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_SaveFile_IO", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveFile", + "return_type": "bool", + "parameters": [ + { + "name": "file", + "type": "const char *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "datasize", + "type": "size_t" + } + ] + }, + { + "name": "SDL_ReadU8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadS8", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8 *" + } + ] + }, + { + "name": "SDL_ReadU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_ReadS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_ReadU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_ReadS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32 *" + } + ] + }, + { + "name": "SDL_ReadU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_ReadU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64 *" + } + ] + }, + { + "name": "SDL_WriteU8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteS8", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint8" + } + ] + }, + { + "name": "SDL_WriteU16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint16" + } + ] + }, + { + "name": "SDL_WriteS16BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_WriteU32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_WriteS32BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint32" + } + ] + }, + { + "name": "SDL_WriteU64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64LE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_WriteU64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteS64BE", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/joystick.json b/official/release-3.4.8/json/joystick.json new file mode 100644 index 0000000..a9aa729 --- /dev/null +++ b/official/release-3.4.8/json/joystick.json @@ -0,0 +1,973 @@ +{ + "header": "SDL_joystick.h", + "opaque_types": [ + { + "name": "SDL_Joystick" + } + ], + "typedefs": [ + { + "name": "SDL_JoystickID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_JoystickType", + "values": [ + { + "name": "SDL_JOYSTICK_TYPE_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_TYPE_GAMEPAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_WHEEL" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK" + }, + { + "name": "SDL_JOYSTICK_TYPE_DANCE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_GUITAR" + }, + { + "name": "SDL_JOYSTICK_TYPE_DRUM_KIT" + }, + { + "name": "SDL_JOYSTICK_TYPE_ARCADE_PAD" + }, + { + "name": "SDL_JOYSTICK_TYPE_THROTTLE" + }, + { + "name": "SDL_JOYSTICK_TYPE_COUNT" + } + ] + }, + { + "name": "SDL_JoystickConnectionState", + "values": [ + { + "name": "SDL_JOYSTICK_CONNECTION_INVALID", + "value": "-1" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_UNKNOWN" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRED" + }, + { + "name": "SDL_JOYSTICK_CONNECTION_WIRELESS" + } + ] + } + ], + "structs": [ + { + "name": "SDL_VirtualJoystickTouchpadDesc", + "fields": [ + { + "name": "nfingers", + "type": "Uint16", + "comment": "the number of simultaneous fingers on this touchpad" + }, + { + "name": "padding", + "type": "Uint16[3]" + } + ] + }, + { + "name": "SDL_VirtualJoystickSensorDesc", + "fields": [ + { + "name": "_type", + "type": "SDL_SensorType", + "comment": "the type of this sensor" + }, + { + "name": "rate", + "type": "float", + "comment": "the update frequency of this sensor, may be 0.0f" + } + ] + }, + { + "name": "SDL_VirtualJoystickDesc", + "fields": [ + { + "name": "version", + "type": "Uint32", + "comment": "the version of this interface" + }, + { + "name": "_type", + "type": "Uint16", + "comment": "`SDL_JoystickType`" + }, + { + "name": "padding", + "type": "Uint16", + "comment": "unused" + }, + { + "name": "vendor_id", + "type": "Uint16", + "comment": "the USB vendor ID of this joystick" + }, + { + "name": "product_id", + "type": "Uint16", + "comment": "the USB product ID of this joystick" + }, + { + "name": "naxes", + "type": "Uint16", + "comment": "the number of axes on this joystick" + }, + { + "name": "nbuttons", + "type": "Uint16", + "comment": "the number of buttons on this joystick" + }, + { + "name": "nballs", + "type": "Uint16", + "comment": "the number of balls on this joystick" + }, + { + "name": "nhats", + "type": "Uint16", + "comment": "the number of hats on this joystick" + }, + { + "name": "ntouchpads", + "type": "Uint16", + "comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions" + }, + { + "name": "nsensors", + "type": "Uint16", + "comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions" + }, + { + "name": "padding2", + "type": "Uint16[2]", + "comment": "unused" + }, + { + "name": "button_mask", + "type": "Uint32" + }, + { + "name": "axis_mask", + "type": "Uint32" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the joystick" + }, + { + "name": "touchpads", + "type": "const SDL_VirtualJoystickTouchpadDesc *", + "comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0" + }, + { + "name": "sensors", + "type": "const SDL_VirtualJoystickSensorDesc *", + "comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0" + }, + { + "name": "userdata", + "type": "void *", + "comment": "User data pointer passed to callbacks" + }, + { + "name": "Update", + "type": "void (SDLCALL *Update)(void *userdata)", + "comment": "Called when the joystick state should be updated" + }, + { + "name": "SetPlayerIndex", + "type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)", + "comment": "Called when the player index is set" + }, + { + "name": "Rumble", + "type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)", + "comment": "Implements SDL_RumbleJoystick()" + }, + { + "name": "RumbleTriggers", + "type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)", + "comment": "Implements SDL_RumbleJoystickTriggers()" + }, + { + "name": "SetLED", + "type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)", + "comment": "Implements SDL_SetJoystickLED()" + }, + { + "name": "SendEffect", + "type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)", + "comment": "Implements SDL_SendJoystickEffect()" + }, + { + "name": "SetSensorsEnabled", + "type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)", + "comment": "Implements SDL_SetGamepadSensorEnabled()" + }, + { + "name": "Cleanup", + "type": "void (SDLCALL *Cleanup)(void *userdata)", + "comment": "Cleans up the userdata when the joystick is detached" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_UnlockJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_HasJoystick", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetJoysticks", + "return_type": "SDL_JoystickID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPathForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndexForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDForID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickVendorForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersionForID", + "return_type": "Uint16", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickTypeForID", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_OpenJoystick", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromID", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_GetJoystickFromPlayerIndex", + "return_type": "SDL_Joystick *", + "parameters": [ + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_AttachVirtualJoystick", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "desc", + "type": "const SDL_VirtualJoystickDesc *" + } + ] + }, + { + "name": "SDL_DetachVirtualJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_IsJoystickVirtual", + "return_type": "bool", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_JoystickID" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualAxis", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "value", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "xrel", + "type": "Sint16" + }, + { + "name": "yrel", + "type": "Sint16" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + }, + { + "name": "down", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualHat", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + }, + { + "name": "value", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetJoystickVirtualTouchpad", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "touchpad", + "type": "int" + }, + { + "name": "finger", + "type": "int" + }, + { + "name": "down", + "type": "bool" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "pressure", + "type": "float" + } + ] + }, + { + "name": "SDL_SendJoystickVirtualSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "_type", + "type": "SDL_SensorType" + }, + { + "name": "sensor_timestamp", + "type": "Uint64" + }, + { + "name": "data", + "type": "const float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickName", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPath", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPlayerIndex", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickPlayerIndex", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "player_index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickGUID", + "return_type": "SDL_GUID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickVendor", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProduct", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickProductVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickFirmwareVersion", + "return_type": "Uint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickSerial", + "return_type": "const char *", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickType", + "return_type": "SDL_JoystickType", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickGUIDInfo", + "return_type": "void", + "parameters": [ + { + "name": "guid", + "type": "SDL_GUID" + }, + { + "name": "vendor", + "type": "Uint16 *" + }, + { + "name": "product", + "type": "Uint16 *" + }, + { + "name": "version", + "type": "Uint16 *" + }, + { + "name": "crc16", + "type": "Uint16 *" + } + ] + }, + { + "name": "SDL_JoystickConnected", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickID", + "return_type": "SDL_JoystickID", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickAxes", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickBalls", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickHats", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetNumJoystickButtons", + "return_type": "int", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_SetJoystickEventsEnabled", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_JoystickEventsEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_UpdateJoysticks", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetJoystickAxis", + "return_type": "Sint16", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickAxisInitialState", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "axis", + "type": "int" + }, + { + "name": "state", + "type": "Sint16 *" + } + ] + }, + { + "name": "SDL_GetJoystickBall", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "ball", + "type": "int" + }, + { + "name": "dx", + "type": "int *" + }, + { + "name": "dy", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetJoystickHat", + "return_type": "Uint8", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "hat", + "type": "int" + } + ] + }, + { + "name": "SDL_GetJoystickButton", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "button", + "type": "int" + } + ] + }, + { + "name": "SDL_RumbleJoystick", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "low_frequency_rumble", + "type": "Uint16" + }, + { + "name": "high_frequency_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_RumbleJoystickTriggers", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "left_rumble", + "type": "Uint16" + }, + { + "name": "right_rumble", + "type": "Uint16" + }, + { + "name": "duration_ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetJoystickLED", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "red", + "type": "Uint8" + }, + { + "name": "green", + "type": "Uint8" + }, + { + "name": "blue", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SendJoystickEffect", + "return_type": "bool", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "size", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseJoystick", + "return_type": "void", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickConnectionState", + "return_type": "SDL_JoystickConnectionState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + } + ] + }, + { + "name": "SDL_GetJoystickPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "joystick", + "type": "SDL_Joystick *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/keyboard.json b/official/release-3.4.8/json/keyboard.json new file mode 100644 index 0000000..6e2e6bf --- /dev/null +++ b/official/release-3.4.8/json/keyboard.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_KeyboardID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextInputType", + "values": [ + { + "name": "SDL_TEXTINPUT_TYPE_TEXT", + "comment": "The input is text" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_NAME", + "comment": "The input is a person's name" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_EMAIL", + "comment": "The input is an e-mail address" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_USERNAME", + "comment": "The input is a username" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN", + "comment": "The input is a secure password that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE", + "comment": "The input is a secure password that is visible" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER", + "comment": "The input is a number" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN", + "comment": "The input is a secure PIN that is hidden" + }, + { + "name": "SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE", + "comment": "The input is a secure PIN that is visible" + } + ] + }, + { + "name": "SDL_Capitalization", + "values": [ + { + "name": "SDL_CAPITALIZE_NONE", + "comment": "No auto-capitalization will be done" + }, + { + "name": "SDL_CAPITALIZE_SENTENCES", + "comment": "The first letter of sentences will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_WORDS", + "comment": "The first letter of words will be capitalized" + }, + { + "name": "SDL_CAPITALIZE_LETTERS", + "comment": "All letters will be capitalized" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasKeyboard", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetKeyboards", + "return_type": "SDL_KeyboardID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetKeyboardNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_KeyboardID" + } + ] + }, + { + "name": "SDL_GetKeyboardFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetKeyboardState", + "return_type": "const bool *", + "parameters": [ + { + "name": "numkeys", + "type": "int *" + } + ] + }, + { + "name": "SDL_ResetKeyboard", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetModState", + "return_type": "SDL_Keymod", + "parameters": [] + }, + { + "name": "SDL_SetModState", + "return_type": "void", + "parameters": [ + { + "name": "modstate", + "type": "SDL_Keymod" + } + ] + }, + { + "name": "SDL_GetKeyFromScancode", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "modstate", + "type": "SDL_Keymod" + }, + { + "name": "key_event", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetScancodeFromKey", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + }, + { + "name": "modstate", + "type": "SDL_Keymod *" + } + ] + }, + { + "name": "SDL_SetScancodeName", + "return_type": "bool", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetScancodeName", + "return_type": "const char *", + "parameters": [ + { + "name": "scancode", + "type": "SDL_Scancode" + } + ] + }, + { + "name": "SDL_GetScancodeFromName", + "return_type": "SDL_Scancode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetKeyName", + "return_type": "const char *", + "parameters": [ + { + "name": "key", + "type": "SDL_Keycode" + } + ] + }, + { + "name": "SDL_GetKeyFromName", + "return_type": "SDL_Keycode", + "parameters": [ + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_StartTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StartTextInputWithProperties", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_TextInputActive", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_StopTextInput", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ClearComposition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "cursor", + "type": "int" + } + ] + }, + { + "name": "SDL_GetTextInputArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + }, + { + "name": "cursor", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasScreenKeyboardSupport", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_ScreenKeyboardShown", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/keycode.json b/official/release-3.4.8/json/keycode.json new file mode 100644 index 0000000..99ad234 --- /dev/null +++ b/official/release-3.4.8/json/keycode.json @@ -0,0 +1,21 @@ +{ + "header": "SDL_keycode.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_Keycode", + "underlying_type": "Uint32" + }, + { + "name": "SDL_Keymod", + "underlying_type": "Uint16" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/loadso.json b/official/release-3.4.8/json/loadso.json new file mode 100644 index 0000000..cbdeced --- /dev/null +++ b/official/release-3.4.8/json/loadso.json @@ -0,0 +1,51 @@ +{ + "header": "SDL_loadso.h", + "opaque_types": [ + { + "name": "SDL_SharedObject" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_LoadObject", + "return_type": "SDL_SharedObject *", + "parameters": [ + { + "name": "sofile", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadFunction", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_UnloadObject", + "return_type": "void", + "parameters": [ + { + "name": "handle", + "type": "SDL_SharedObject *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/messagebox.json b/official/release-3.4.8/json/messagebox.json new file mode 100644 index 0000000..d9ab053 --- /dev/null +++ b/official/release-3.4.8/json/messagebox.json @@ -0,0 +1,205 @@ +{ + "header": "SDL_messagebox.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_MessageBoxColorType", + "values": [ + { + "name": "SDL_MESSAGEBOX_COLOR_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_TEXT" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED" + }, + { + "name": "SDL_MESSAGEBOX_COLOR_COUNT", + "comment": "Size of the colors array of SDL_MessageBoxColorScheme." + } + ] + } + ], + "structs": [ + { + "name": "SDL_MessageBoxButtonData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxButtonFlags" + }, + { + "name": "buttonID", + "type": "int", + "comment": "User defined button id (value returned via SDL_ShowMessageBox)" + }, + { + "name": "text", + "type": "const char *", + "comment": "The UTF-8 button text" + } + ] + }, + { + "name": "SDL_MessageBoxColor", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MessageBoxColorScheme", + "fields": [ + { + "name": "colors", + "type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]" + } + ] + }, + { + "name": "SDL_MessageBoxData", + "fields": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "window", + "type": "SDL_Window *", + "comment": "Parent window, can be NULL" + }, + { + "name": "title", + "type": "const char *", + "comment": "UTF-8 title" + }, + { + "name": "message", + "type": "const char *", + "comment": "UTF-8 message text" + }, + { + "name": "numbuttons", + "type": "int" + }, + { + "name": "buttons", + "type": "const SDL_MessageBoxButtonData *" + }, + { + "name": "colorScheme", + "type": "const SDL_MessageBoxColorScheme *", + "comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MessageBoxFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_ERROR", + "value": "(1u << 4)", + "comment": "error dialog" + }, + { + "name": "SDL_MESSAGEBOX_WARNING", + "value": "(1u << 5)", + "comment": "warning dialog" + }, + { + "name": "SDL_MESSAGEBOX_INFORMATION", + "value": "(1u << 6)", + "comment": "informational dialog" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT", + "value": "(1u << 7)", + "comment": "buttons placed left to right" + }, + { + "name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT", + "value": "(1u << 8)", + "comment": "buttons placed right to left" + } + ] + }, + { + "name": "SDL_MessageBoxButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT", + "value": "(1u << 0)", + "comment": "Marks the default button when return is hit" + }, + { + "name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT", + "value": "(1u << 1)", + "comment": "Marks the default button when escape is hit" + } + ] + } + ], + "functions": [ + { + "name": "SDL_ShowMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "messageboxdata", + "type": "const SDL_MessageBoxData *" + }, + { + "name": "buttonid", + "type": "int *" + } + ] + }, + { + "name": "SDL_ShowSimpleMessageBox", + "return_type": "bool", + "parameters": [ + { + "name": "flags", + "type": "SDL_MessageBoxFlags" + }, + { + "name": "title", + "type": "const char *" + }, + { + "name": "message", + "type": "const char *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/misc.json b/official/release-3.4.8/json/misc.json new file mode 100644 index 0000000..fe9327f --- /dev/null +++ b/official/release-3.4.8/json/misc.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_misc.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenURL", + "return_type": "bool", + "parameters": [ + { + "name": "url", + "type": "const char *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/mouse.json b/official/release-3.4.8/json/mouse.json new file mode 100644 index 0000000..b8bbf8b --- /dev/null +++ b/official/release-3.4.8/json/mouse.json @@ -0,0 +1,440 @@ +{ + "header": "SDL_mouse.h", + "opaque_types": [ + { + "name": "SDL_Cursor" + } + ], + "typedefs": [ + { + "name": "SDL_MouseID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_MouseMotionTransformCallback" + } + ], + "enums": [ + { + "name": "SDL_SystemCursor", + "values": [ + { + "name": "SDL_SYSTEM_CURSOR_DEFAULT", + "comment": "Default cursor. Usually an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_TEXT", + "comment": "Text selection. Usually an I-beam." + }, + { + "name": "SDL_SYSTEM_CURSOR_WAIT", + "comment": "Wait. Usually an hourglass or watch or spinning ball." + }, + { + "name": "SDL_SYSTEM_CURSOR_CROSSHAIR", + "comment": "Crosshair." + }, + { + "name": "SDL_SYSTEM_CURSOR_PROGRESS", + "comment": "Program is busy but still interactive. Usually it's WAIT with an arrow." + }, + { + "name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE", + "comment": "Double arrow pointing northwest and southeast." + }, + { + "name": "SDL_SYSTEM_CURSOR_NESW_RESIZE", + "comment": "Double arrow pointing northeast and southwest." + }, + { + "name": "SDL_SYSTEM_CURSOR_EW_RESIZE", + "comment": "Double arrow pointing west and east." + }, + { + "name": "SDL_SYSTEM_CURSOR_NS_RESIZE", + "comment": "Double arrow pointing north and south." + }, + { + "name": "SDL_SYSTEM_CURSOR_MOVE", + "comment": "Four pointed arrow pointing north, south, east, and west." + }, + { + "name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED", + "comment": "Not permitted. Usually a slashed circle or crossbones." + }, + { + "name": "SDL_SYSTEM_CURSOR_POINTER", + "comment": "Pointer that indicates a link. Usually a pointing hand." + }, + { + "name": "SDL_SYSTEM_CURSOR_NW_RESIZE", + "comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_N_RESIZE", + "comment": "Window resize top. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_NE_RESIZE", + "comment": "Window resize top-right. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_E_RESIZE", + "comment": "Window resize right. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SE_RESIZE", + "comment": "Window resize bottom-right. May be NWSE_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_S_RESIZE", + "comment": "Window resize bottom. May be NS_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_SW_RESIZE", + "comment": "Window resize bottom-left. May be NESW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_W_RESIZE", + "comment": "Window resize left. May be EW_RESIZE." + }, + { + "name": "SDL_SYSTEM_CURSOR_COUNT" + } + ] + }, + { + "name": "SDL_MouseWheelDirection", + "values": [ + { + "name": "SDL_MOUSEWHEEL_NORMAL", + "comment": "The scroll direction is normal" + }, + { + "name": "SDL_MOUSEWHEEL_FLIPPED", + "comment": "The scroll direction is flipped / natural" + } + ] + } + ], + "structs": [ + { + "name": "SDL_CursorFrameInfo", + "fields": [ + { + "name": "surface", + "type": "SDL_Surface *", + "comment": "The surface data for this frame" + }, + { + "name": "duration", + "type": "Uint32", + "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_MouseButtonFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_BUTTON_LEFT", + "value": "(1u << 0)" + }, + { + "name": "SDL_BUTTON_MIDDLE", + "value": "(1u << 1)" + }, + { + "name": "SDL_BUTTON_X1", + "value": "(1u << 2)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_HasMouse", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetMice", + "return_type": "SDL_MouseID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetMouseNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_MouseID" + } + ] + }, + { + "name": "SDL_GetMouseFocus", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GetMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetGlobalMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetRelativeMouseState", + "return_type": "SDL_MouseButtonFlags", + "parameters": [ + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_WarpMouseInWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_WarpMouseGlobal", + "return_type": "bool", + "parameters": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_SetRelativeMouseTransform", + "return_type": "bool", + "parameters": [ + { + "name": "callback", + "type": "SDL_MouseMotionTransformCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowRelativeMouseMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_CaptureMouse", + "return_type": "bool", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "data", + "type": "const Uint8 *" + }, + { + "name": "mask", + "type": "const Uint8 *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateColorCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateAnimatedCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "frames", + "type": "SDL_CursorFrameInfo *" + }, + { + "name": "frame_count", + "type": "int" + }, + { + "name": "hot_x", + "type": "int" + }, + { + "name": "hot_y", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateSystemCursor", + "return_type": "SDL_Cursor *", + "parameters": [ + { + "name": "id", + "type": "SDL_SystemCursor" + } + ] + }, + { + "name": "SDL_SetCursor", + "return_type": "bool", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_GetCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_GetDefaultCursor", + "return_type": "SDL_Cursor *", + "parameters": [] + }, + { + "name": "SDL_DestroyCursor", + "return_type": "void", + "parameters": [ + { + "name": "cursor", + "type": "SDL_Cursor *" + } + ] + }, + { + "name": "SDL_ShowCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_HideCursor", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_CursorVisible", + "return_type": "bool", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/opengl.json b/official/release-3.4.8/json/opengl.json new file mode 100644 index 0000000..2d86db0 --- /dev/null +++ b/official/release-3.4.8/json/opengl.json @@ -0,0 +1,12 @@ +{ + "header": "SDL_opengl.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/pen.json b/official/release-3.4.8/json/pen.json new file mode 100644 index 0000000..ac4189c --- /dev/null +++ b/official/release-3.4.8/json/pen.json @@ -0,0 +1,135 @@ +{ + "header": "SDL_pen.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PenID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PenAxis", + "values": [ + { + "name": "SDL_PEN_AXIS_PRESSURE", + "comment": "Pen pressure. Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_XTILT", + "comment": "Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right)." + }, + { + "name": "SDL_PEN_AXIS_YTILT", + "comment": "Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down)." + }, + { + "name": "SDL_PEN_AXIS_DISTANCE", + "comment": "Pen distance to drawing surface. Unidirectional: 0.0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_ROTATION", + "comment": "Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down)." + }, + { + "name": "SDL_PEN_AXIS_SLIDER", + "comment": "Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0" + }, + { + "name": "SDL_PEN_AXIS_TANGENTIAL_PRESSURE", + "comment": "Pressure from squeezing the pen (\"barrel pressure\")." + }, + { + "name": "SDL_PEN_AXIS_COUNT", + "comment": "Total known pen axis types in this version of SDL. This number may grow in future releases!" + } + ] + }, + { + "name": "SDL_PenDeviceType", + "values": [ + { + "name": "SDL_PEN_DEVICE_TYPE_INVALID", + "value": "-1", + "comment": "Not a valid pen device." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_UNKNOWN", + "comment": "Don't know specifics of this pen." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_DIRECT", + "comment": "Pen touches display." + }, + { + "name": "SDL_PEN_DEVICE_TYPE_INDIRECT", + "comment": "Pen touches something that isn't the display." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_PenInputFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_PEN_INPUT_DOWN", + "value": "(1u << 0)", + "comment": "pen is pressed down" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_1", + "value": "(1u << 1)", + "comment": "button 1 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_2", + "value": "(1u << 2)", + "comment": "button 2 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_3", + "value": "(1u << 3)", + "comment": "button 3 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_4", + "value": "(1u << 4)", + "comment": "button 4 is pressed" + }, + { + "name": "SDL_PEN_INPUT_BUTTON_5", + "value": "(1u << 5)", + "comment": "button 5 is pressed" + }, + { + "name": "SDL_PEN_INPUT_ERASER_TIP", + "value": "(1u << 30)", + "comment": "eraser tip is used" + }, + { + "name": "SDL_PEN_INPUT_IN_PROXIMITY", + "value": "(1u << 31)", + "comment": "pen is in proximity (since SDL 3.4.0)" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetPenDeviceType", + "return_type": "SDL_PenDeviceType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_PenID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/pixels.json b/official/release-3.4.8/json/pixels.json new file mode 100644 index 0000000..b5e344c --- /dev/null +++ b/official/release-3.4.8/json/pixels.json @@ -0,0 +1,1214 @@ +{ + "header": "SDL_pixels.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PixelType", + "values": [ + { + "name": "SDL_PIXELTYPE_UNKNOWN" + }, + { + "name": "SDL_PIXELTYPE_INDEX1" + }, + { + "name": "SDL_PIXELTYPE_INDEX4" + }, + { + "name": "SDL_PIXELTYPE_INDEX8" + }, + { + "name": "SDL_PIXELTYPE_PACKED8" + }, + { + "name": "SDL_PIXELTYPE_PACKED16" + }, + { + "name": "SDL_PIXELTYPE_PACKED32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU8" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYU32" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF16" + }, + { + "name": "SDL_PIXELTYPE_ARRAYF32" + }, + { + "name": "SDL_PIXELTYPE_INDEX2" + } + ] + }, + { + "name": "SDL_BitmapOrder", + "values": [ + { + "name": "SDL_BITMAPORDER_NONE" + }, + { + "name": "SDL_BITMAPORDER_4321" + }, + { + "name": "SDL_BITMAPORDER_1234" + } + ] + }, + { + "name": "SDL_PackedOrder", + "values": [ + { + "name": "SDL_PACKEDORDER_NONE" + }, + { + "name": "SDL_PACKEDORDER_XRGB" + }, + { + "name": "SDL_PACKEDORDER_RGBX" + }, + { + "name": "SDL_PACKEDORDER_ARGB" + }, + { + "name": "SDL_PACKEDORDER_RGBA" + }, + { + "name": "SDL_PACKEDORDER_XBGR" + }, + { + "name": "SDL_PACKEDORDER_BGRX" + }, + { + "name": "SDL_PACKEDORDER_ABGR" + }, + { + "name": "SDL_PACKEDORDER_BGRA" + } + ] + }, + { + "name": "SDL_ArrayOrder", + "values": [ + { + "name": "SDL_ARRAYORDER_NONE" + }, + { + "name": "SDL_ARRAYORDER_RGB" + }, + { + "name": "SDL_ARRAYORDER_RGBA" + }, + { + "name": "SDL_ARRAYORDER_ARGB" + }, + { + "name": "SDL_ARRAYORDER_BGR" + }, + { + "name": "SDL_ARRAYORDER_BGRA" + }, + { + "name": "SDL_ARRAYORDER_ABGR" + } + ] + }, + { + "name": "SDL_PackedLayout", + "values": [ + { + "name": "SDL_PACKEDLAYOUT_NONE" + }, + { + "name": "SDL_PACKEDLAYOUT_332" + }, + { + "name": "SDL_PACKEDLAYOUT_4444" + }, + { + "name": "SDL_PACKEDLAYOUT_1555" + }, + { + "name": "SDL_PACKEDLAYOUT_5551" + }, + { + "name": "SDL_PACKEDLAYOUT_565" + }, + { + "name": "SDL_PACKEDLAYOUT_8888" + }, + { + "name": "SDL_PACKEDLAYOUT_2101010" + }, + { + "name": "SDL_PACKEDLAYOUT_1010102" + } + ] + }, + { + "name": "SDL_PixelFormat", + "values": [ + { + "name": "SDL_PIXELFORMAT_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1LSB", + "value": "0x11100100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX1MSB", + "value": "0x11200100u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2LSB", + "value": "0x1c100200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX2MSB", + "value": "0x1c200200u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4LSB", + "value": "0x12100400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX4MSB", + "value": "0x12200400u" + }, + { + "name": "SDL_PIXELFORMAT_INDEX8", + "value": "0x13000801u" + }, + { + "name": "SDL_PIXELFORMAT_RGB332", + "value": "0x14110801u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB4444", + "value": "0x15120c02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR4444", + "value": "0x15520c02u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB1555", + "value": "0x15130f02u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR1555", + "value": "0x15530f02u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB4444", + "value": "0x15321002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA4444", + "value": "0x15421002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR4444", + "value": "0x15721002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA4444", + "value": "0x15821002u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB1555", + "value": "0x15331002u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA5551", + "value": "0x15441002u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR1555", + "value": "0x15731002u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA5551", + "value": "0x15841002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB565", + "value": "0x15151002u" + }, + { + "name": "SDL_PIXELFORMAT_BGR565", + "value": "0x15551002u" + }, + { + "name": "SDL_PIXELFORMAT_RGB24", + "value": "0x17101803u" + }, + { + "name": "SDL_PIXELFORMAT_BGR24", + "value": "0x17401803u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB8888", + "value": "0x16161804u" + }, + { + "name": "SDL_PIXELFORMAT_RGBX8888", + "value": "0x16261804u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR8888", + "value": "0x16561804u" + }, + { + "name": "SDL_PIXELFORMAT_BGRX8888", + "value": "0x16661804u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB8888", + "value": "0x16362004u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA8888", + "value": "0x16462004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR8888", + "value": "0x16762004u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA8888", + "value": "0x16862004u" + }, + { + "name": "SDL_PIXELFORMAT_XRGB2101010", + "value": "0x16172004u" + }, + { + "name": "SDL_PIXELFORMAT_XBGR2101010", + "value": "0x16572004u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB2101010", + "value": "0x16372004u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR2101010", + "value": "0x16772004u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48", + "value": "0x18103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48", + "value": "0x18403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64", + "value": "0x18204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64", + "value": "0x18304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64", + "value": "0x18504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64", + "value": "0x18604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB48_FLOAT", + "value": "0x1a103006u" + }, + { + "name": "SDL_PIXELFORMAT_BGR48_FLOAT", + "value": "0x1a403006u" + }, + { + "name": "SDL_PIXELFORMAT_RGBA64_FLOAT", + "value": "0x1a204008u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB64_FLOAT", + "value": "0x1a304008u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA64_FLOAT", + "value": "0x1a504008u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR64_FLOAT", + "value": "0x1a604008u" + }, + { + "name": "SDL_PIXELFORMAT_RGB96_FLOAT", + "value": "0x1b10600cu" + }, + { + "name": "SDL_PIXELFORMAT_BGR96_FLOAT", + "value": "0x1b40600cu" + }, + { + "name": "SDL_PIXELFORMAT_RGBA128_FLOAT", + "value": "0x1b208010u" + }, + { + "name": "SDL_PIXELFORMAT_ARGB128_FLOAT", + "value": "0x1b308010u" + }, + { + "name": "SDL_PIXELFORMAT_BGRA128_FLOAT", + "value": "0x1b508010u" + }, + { + "name": "SDL_PIXELFORMAT_ABGR128_FLOAT", + "value": "0x1b608010u" + }, + { + "name": "SDL_PIXELFORMAT_YV12", + "value": "0x32315659u", + "comment": "Planar mode: Y + V + U (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_IYUV", + "value": "0x56555949u", + "comment": "Planar mode: Y + U + V (3 planes)" + }, + { + "name": "SDL_PIXELFORMAT_YUY2", + "value": "0x32595559u", + "comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_UYVY", + "value": "0x59565955u", + "comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_YVYU", + "value": "0x55595659u", + "comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)" + }, + { + "name": "SDL_PIXELFORMAT_NV12", + "value": "0x3231564eu", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_NV21", + "value": "0x3132564eu", + "comment": "Planar mode: Y + V/U interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_P010", + "value": "0x30313050u", + "comment": "Planar mode: Y + U/V interleaved (2 planes)" + }, + { + "name": "SDL_PIXELFORMAT_EXTERNAL_OES", + "value": "0x2053454fu", + "comment": "Android video texture format" + }, + { + "name": "SDL_PIXELFORMAT_MJPG", + "value": "0x47504a4du", + "comment": "Motion JPEG" + }, + { + "name": "SDL_PIXELFORMAT_RGBA32", + "value": "SDL_PIXELFORMAT_ABGR8888" + }, + { + "name": "SDL_PIXELFORMAT_ARGB32", + "value": "SDL_PIXELFORMAT_BGRA8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRA32", + "value": "SDL_PIXELFORMAT_ARGB8888" + }, + { + "name": "SDL_PIXELFORMAT_ABGR32", + "value": "SDL_PIXELFORMAT_RGBA8888" + }, + { + "name": "SDL_PIXELFORMAT_RGBX32", + "value": "SDL_PIXELFORMAT_XBGR8888" + }, + { + "name": "SDL_PIXELFORMAT_XRGB32", + "value": "SDL_PIXELFORMAT_BGRX8888" + }, + { + "name": "SDL_PIXELFORMAT_BGRX32", + "value": "SDL_PIXELFORMAT_XRGB8888" + }, + { + "name": "SDL_PIXELFORMAT_XBGR32", + "value": "SDL_PIXELFORMAT_RGBX8888" + } + ] + }, + { + "name": "SDL_ColorType", + "values": [ + { + "name": "SDL_COLOR_TYPE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_TYPE_RGB", + "value": "1" + }, + { + "name": "SDL_COLOR_TYPE_YCBCR", + "value": "2" + } + ] + }, + { + "name": "SDL_ColorRange", + "values": [ + { + "name": "SDL_COLOR_RANGE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_RANGE_LIMITED", + "value": "1", + "comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma" + }, + { + "name": "SDL_COLOR_RANGE_FULL", + "value": "2", + "comment": "Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma" + } + ] + }, + { + "name": "SDL_ColorPrimaries", + "values": [ + { + "name": "SDL_COLOR_PRIMARIES_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470M", + "value": "4", + "comment": "ITU-R BT.470-6 System M" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525, SMPTE 170M" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE240", + "value": "7", + "comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601" + }, + { + "name": "SDL_COLOR_PRIMARIES_GENERIC_FILM", + "value": "8", + "comment": "Generic film (color filters using Illuminant C)" + }, + { + "name": "SDL_COLOR_PRIMARIES_BT2020", + "value": "9", + "comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0" + }, + { + "name": "SDL_COLOR_PRIMARIES_XYZ", + "value": "10", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE431", + "value": "11", + "comment": "SMPTE RP 431-2" + }, + { + "name": "SDL_COLOR_PRIMARIES_SMPTE432", + "value": "12", + "comment": "SMPTE EG 432-1 / DCI P3" + }, + { + "name": "SDL_COLOR_PRIMARIES_EBU3213", + "value": "22", + "comment": "EBU Tech. 3213-E" + }, + { + "name": "SDL_COLOR_PRIMARIES_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_TransferCharacteristics", + "values": [ + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT709", + "value": "1", + "comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22", + "value": "4", + "comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT601", + "value": "6", + "comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240", + "value": "7", + "comment": "SMPTE ST 240M" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", + "value": "8" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", + "value": "9" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", + "value": "10" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966", + "value": "11", + "comment": "IEC 61966-2-4" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT1361", + "value": "12", + "comment": "ITU-R BT1361 Extended Colour Gamut" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SRGB", + "value": "13", + "comment": "IEC 61966-2-1 (sRGB or sYCC)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT", + "value": "14", + "comment": "ITU-R BT2020 for 10-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT", + "value": "15", + "comment": "ITU-R BT2020 for 12-bit system" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_PQ", + "value": "16", + "comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428", + "value": "17", + "comment": "SMPTE ST 428-1" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_HLG", + "value": "18", + "comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)" + }, + { + "name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_MatrixCoefficients", + "values": [ + { + "name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", + "value": "0" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT709", + "value": "1", + "comment": "ITU-R BT.709-6" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", + "value": "2" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_FCC", + "value": "4", + "comment": "US FCC Title 47" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT470BG", + "value": "5", + "comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT601", + "value": "6", + "comment": "ITU-R BT.601-7 525" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE240", + "value": "7", + "comment": "SMPTE 240M" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_YCGCO", + "value": "8" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL", + "value": "9", + "comment": "ITU-R BT.2020-2 non-constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL", + "value": "10", + "comment": "ITU-R BT.2020-2 constant luminance" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085", + "value": "11", + "comment": "SMPTE ST 2085" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", + "value": "12" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", + "value": "13" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_ICTCP", + "value": "14", + "comment": "ITU-R BT.2100-0 ICTCP" + }, + { + "name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", + "value": "31" + } + ] + }, + { + "name": "SDL_ChromaLocation", + "values": [ + { + "name": "SDL_CHROMA_LOCATION_NONE", + "value": "0", + "comment": "RGB, no chroma sampling" + }, + { + "name": "SDL_CHROMA_LOCATION_LEFT", + "value": "1", + "comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically." + }, + { + "name": "SDL_CHROMA_LOCATION_CENTER", + "value": "2", + "comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel." + }, + { + "name": "SDL_CHROMA_LOCATION_TOPLEFT", + "value": "3", + "comment": "In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel (\"co-sited\", \"co-located\")." + } + ] + }, + { + "name": "SDL_Colorspace", + "values": [ + { + "name": "SDL_COLORSPACE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_COLORSPACE_SRGB", + "value": "0x120005a0u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_SRGB_LINEAR", + "value": "0x12000500u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709" + }, + { + "name": "SDL_COLORSPACE_HDR10", + "value": "0x12002600u", + "comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020" + }, + { + "name": "SDL_COLORSPACE_JPEG", + "value": "0x220004c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601" + }, + { + "name": "SDL_COLORSPACE_BT601_LIMITED", + "value": "0x211018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT601_FULL", + "value": "0x221018c6u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601" + }, + { + "name": "SDL_COLORSPACE_BT709_LIMITED", + "value": "0x21100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT709_FULL", + "value": "0x22100421u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709" + }, + { + "name": "SDL_COLORSPACE_BT2020_LIMITED", + "value": "0x21102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_BT2020_FULL", + "value": "0x22102609u", + "comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020" + }, + { + "name": "SDL_COLORSPACE_RGB_DEFAULT", + "value": "SDL_COLORSPACE_SRGB", + "comment": "The default colorspace for RGB surfaces if no colorspace is specified" + }, + { + "name": "SDL_COLORSPACE_YUV_DEFAULT", + "value": "SDL_COLORSPACE_BT601_LIMITED", + "comment": "The default colorspace for YUV surfaces if no colorspace is specified" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Color", + "fields": [ + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_FColor", + "fields": [ + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_Palette", + "fields": [ + { + "name": "ncolors", + "type": "int", + "comment": "number of elements in `colors`." + }, + { + "name": "colors", + "type": "SDL_Color *", + "comment": "an array of colors, `ncolors` long." + }, + { + "name": "version", + "type": "Uint32", + "comment": "internal use only, do not touch." + }, + { + "name": "refcount", + "type": "int", + "comment": "internal use only, do not touch." + } + ] + }, + { + "name": "SDL_PixelFormatDetails", + "fields": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bits_per_pixel", + "type": "Uint8" + }, + { + "name": "bytes_per_pixel", + "type": "Uint8" + }, + { + "name": "padding", + "type": "Uint8[2]" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + }, + { + "name": "Rbits", + "type": "Uint8" + }, + { + "name": "Gbits", + "type": "Uint8" + }, + { + "name": "Bbits", + "type": "Uint8" + }, + { + "name": "Abits", + "type": "Uint8" + }, + { + "name": "Rshift", + "type": "Uint8" + }, + { + "name": "Gshift", + "type": "Uint8" + }, + { + "name": "Bshift", + "type": "Uint8" + }, + { + "name": "Ashift", + "type": "Uint8" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPixelFormatName", + "return_type": "const char *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_GetMasksForPixelFormat", + "return_type": "bool", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "bpp", + "type": "int *" + }, + { + "name": "Rmask", + "type": "Uint32 *" + }, + { + "name": "Gmask", + "type": "Uint32 *" + }, + { + "name": "Bmask", + "type": "Uint32 *" + }, + { + "name": "Amask", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_GetPixelFormatForMasks", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "bpp", + "type": "int" + }, + { + "name": "Rmask", + "type": "Uint32" + }, + { + "name": "Gmask", + "type": "Uint32" + }, + { + "name": "Bmask", + "type": "Uint32" + }, + { + "name": "Amask", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetPixelFormatDetails", + "return_type": "const SDL_PixelFormatDetails *", + "parameters": [ + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreatePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_SetPaletteColors", + "return_type": "bool", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colors", + "type": "const SDL_Color *" + }, + { + "name": "firstcolor", + "type": "int" + }, + { + "name": "ncolors", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyPalette", + "return_type": "void", + "parameters": [ + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_MapRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetRGB", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRGBA", + "return_type": "void", + "parameters": [ + { + "name": "pixelvalue", + "type": "Uint32" + }, + { + "name": "format", + "type": "const SDL_PixelFormatDetails *" + }, + { + "name": "palette", + "type": "const SDL_Palette *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/power.json b/official/release-3.4.8/json/power.json new file mode 100644 index 0000000..138917b --- /dev/null +++ b/official/release-3.4.8/json/power.json @@ -0,0 +1,58 @@ +{ + "header": "SDL_power.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_PowerState", + "values": [ + { + "name": "SDL_POWERSTATE_ERROR", + "value": "-1", + "comment": "error determining power status" + }, + { + "name": "SDL_POWERSTATE_UNKNOWN", + "comment": "cannot determine power status" + }, + { + "name": "SDL_POWERSTATE_ON_BATTERY", + "comment": "Not plugged in, running on the battery" + }, + { + "name": "SDL_POWERSTATE_NO_BATTERY", + "comment": "Plugged in, no battery available" + }, + { + "name": "SDL_POWERSTATE_CHARGING", + "comment": "Plugged in, charging battery" + }, + { + "name": "SDL_POWERSTATE_CHARGED", + "comment": "Plugged in, battery charged" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetPowerInfo", + "return_type": "SDL_PowerState", + "parameters": [ + { + "name": "seconds", + "type": "int *" + }, + { + "name": "percent", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/process.json b/official/release-3.4.8/json/process.json new file mode 100644 index 0000000..ce2ad75 --- /dev/null +++ b/official/release-3.4.8/json/process.json @@ -0,0 +1,153 @@ +{ + "header": "SDL_process.h", + "opaque_types": [ + { + "name": "SDL_Process" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ProcessIO", + "values": [ + { + "name": "SDL_PROCESS_STDIO_INHERITED", + "comment": "The I/O stream is inherited from the application." + }, + { + "name": "SDL_PROCESS_STDIO_NULL", + "comment": "The I/O stream is ignored." + }, + { + "name": "SDL_PROCESS_STDIO_APP", + "comment": "The I/O stream is connected to a new SDL_IOStream that the application can read or write" + }, + { + "name": "SDL_PROCESS_STDIO_REDIRECT", + "comment": "The I/O stream is redirected to an existing SDL_IOStream." + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_CreateProcess", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "args", + "type": "const char * const *" + }, + { + "name": "pipe_stdio", + "type": "bool" + } + ] + }, + { + "name": "SDL_CreateProcessWithProperties", + "return_type": "SDL_Process *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetProcessProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_ReadProcess", + "return_type": "void *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "datasize", + "type": "size_t *" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetProcessInput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_GetProcessOutput", + "return_type": "SDL_IOStream *", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + }, + { + "name": "SDL_KillProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "force", + "type": "bool" + } + ] + }, + { + "name": "SDL_WaitProcess", + "return_type": "bool", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + }, + { + "name": "block", + "type": "bool" + }, + { + "name": "exitcode", + "type": "int *" + } + ] + }, + { + "name": "SDL_DestroyProcess", + "return_type": "void", + "parameters": [ + { + "name": "process", + "type": "SDL_Process *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/properties.json b/official/release-3.4.8/json/properties.json new file mode 100644 index 0000000..0109e27 --- /dev/null +++ b/official/release-3.4.8/json/properties.json @@ -0,0 +1,369 @@ +{ + "header": "SDL_properties.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_PropertiesID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_CleanupPropertyCallback" + }, + { + "name": "SDL_EnumeratePropertiesCallback" + } + ], + "enums": [ + { + "name": "SDL_PropertyType", + "values": [ + { + "name": "SDL_PROPERTY_TYPE_INVALID" + }, + { + "name": "SDL_PROPERTY_TYPE_POINTER" + }, + { + "name": "SDL_PROPERTY_TYPE_STRING" + }, + { + "name": "SDL_PROPERTY_TYPE_NUMBER" + }, + { + "name": "SDL_PROPERTY_TYPE_FLOAT" + }, + { + "name": "SDL_PROPERTY_TYPE_BOOLEAN" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetGlobalProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CreateProperties", + "return_type": "SDL_PropertiesID", + "parameters": [] + }, + { + "name": "SDL_CopyProperties", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_LockProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_UnlockProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_SetPointerPropertyWithCleanup", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + }, + { + "name": "cleanup", + "type": "SDL_CleanupPropertyCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetPointerProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetStringProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetNumberProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetFloatProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_SetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "SDL_HasProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPropertyType", + "return_type": "SDL_PropertyType", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetPointerProperty", + "return_type": "void *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetStringProperty", + "return_type": "const char *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetNumberProperty", + "return_type": "Sint64", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_GetFloatProperty", + "return_type": "float", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetBooleanProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + }, + { + "name": "default_value", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearProperty", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateProperties", + "return_type": "bool", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + }, + { + "name": "callback", + "type": "SDL_EnumeratePropertiesCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_DestroyProperties", + "return_type": "void", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/rect.json b/official/release-3.4.8/json/rect.json new file mode 100644 index 0000000..16f6d98 --- /dev/null +++ b/official/release-3.4.8/json/rect.json @@ -0,0 +1,278 @@ +{ + "header": "SDL_rect.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_Point", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_FPoint", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_Rect", + "fields": [ + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_FRect", + "fields": [ + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "w", + "type": "float" + }, + { + "name": "h", + "type": "float" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_HasRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectUnion", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_Rect *" + }, + { + "name": "B", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPoints", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_Point *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_Rect *" + }, + { + "name": "result", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersection", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "X1", + "type": "int *" + }, + { + "name": "Y1", + "type": "int *" + }, + { + "name": "X2", + "type": "int *" + }, + { + "name": "Y2", + "type": "int *" + } + ] + }, + { + "name": "SDL_HasRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectUnionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "A", + "type": "const SDL_FRect *" + }, + { + "name": "B", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectEnclosingPointsFloat", + "return_type": "bool", + "parameters": [ + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "clip", + "type": "const SDL_FRect *" + }, + { + "name": "result", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_GetRectAndLineIntersectionFloat", + "return_type": "bool", + "parameters": [ + { + "name": "rect", + "type": "const SDL_FRect *" + }, + { + "name": "X1", + "type": "float *" + }, + { + "name": "Y1", + "type": "float *" + }, + { + "name": "X2", + "type": "float *" + }, + { + "name": "Y2", + "type": "float *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/render.json b/official/release-3.4.8/json/render.json new file mode 100644 index 0000000..e249ba0 --- /dev/null +++ b/official/release-3.4.8/json/render.json @@ -0,0 +1,1930 @@ +{ + "header": "SDL_render.h", + "opaque_types": [ + { + "name": "SDL_Renderer" + }, + { + "name": "SDL_Texture" + }, + { + "name": "SDL_GPURenderState" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TextureAccess", + "values": [ + { + "name": "SDL_TEXTUREACCESS_STATIC", + "comment": "Changes rarely, not lockable" + }, + { + "name": "SDL_TEXTUREACCESS_STREAMING", + "comment": "Changes frequently, lockable" + }, + { + "name": "SDL_TEXTUREACCESS_TARGET", + "comment": "Texture can be used as a render target" + } + ] + }, + { + "name": "SDL_TextureAddressMode", + "values": [ + { + "name": "SDL_TEXTURE_ADDRESS_INVALID", + "value": "-1" + }, + { + "name": "SDL_TEXTURE_ADDRESS_AUTO", + "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" + }, + { + "name": "SDL_TEXTURE_ADDRESS_CLAMP", + "comment": "Texture coordinates are clamped to the [0, 1] range" + }, + { + "name": "SDL_TEXTURE_ADDRESS_WRAP", + "comment": "The texture is repeated (tiled)" + } + ] + }, + { + "name": "SDL_RendererLogicalPresentation", + "values": [ + { + "name": "SDL_LOGICAL_PRESENTATION_DISABLED", + "comment": "There is no logical size in effect" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_STRETCH", + "comment": "The rendered content is stretched to the output resolution" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", + "comment": "The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds" + }, + { + "name": "SDL_LOGICAL_PRESENTATION_INTEGER_SCALE", + "comment": "The rendered content is scaled up by integer multiples to fit the output resolution" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Vertex", + "fields": [ + { + "name": "position", + "type": "SDL_FPoint", + "comment": "Vertex position, in SDL_Renderer coordinates" + }, + { + "name": "color", + "type": "SDL_FColor", + "comment": "Vertex color" + }, + { + "name": "tex_coord", + "type": "SDL_FPoint", + "comment": "Normalized texture coordinates, if needed" + } + ] + }, + { + "name": "SDL_GPURenderStateCreateInfo", + "fields": [ + { + "name": "fragment_shader", + "type": "SDL_GPUShader *", + "comment": "The fragment shader to use when this render state is active" + }, + { + "name": "num_sampler_bindings", + "type": "Sint32", + "comment": "The number of additional fragment samplers to bind when this render state is active" + }, + { + "name": "sampler_bindings", + "type": "const SDL_GPUTextureSamplerBinding *", + "comment": "Additional fragment samplers to bind when this render state is active" + }, + { + "name": "num_storage_textures", + "type": "Sint32", + "comment": "The number of storage textures to bind when this render state is active" + }, + { + "name": "storage_textures", + "type": "SDL_GPUTexture *const *", + "comment": "Storage textures to bind when this render state is active" + }, + { + "name": "num_storage_buffers", + "type": "Sint32", + "comment": "The number of storage buffers to bind when this render state is active" + }, + { + "name": "storage_buffers", + "type": "SDL_GPUBuffer *const *", + "comment": "Storage buffers to bind when this render state is active" + }, + { + "name": "props", + "type": "SDL_PropertiesID", + "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetNumRenderDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRenderDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateWindowAndRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "window_flags", + "type": "SDL_WindowFlags" + }, + { + "name": "window", + "type": "SDL_Window **" + }, + { + "name": "renderer", + "type": "SDL_Renderer **" + } + ] + }, + { + "name": "SDL_CreateRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "name", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateRendererWithProperties", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_CreateGPURenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "device", + "type": "SDL_GPUDevice *" + }, + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGPURendererDevice", + "return_type": "SDL_GPUDevice *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_CreateSoftwareRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetRenderer", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetRenderWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererName", + "return_type": "const char *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRendererProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetCurrentRenderOutputSize", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateTexture", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "access", + "type": "SDL_TextureAccess" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_CreateTextureFromSurface", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateTextureWithProperties", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetTextureProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRendererFromTexture", + "return_type": "SDL_Renderer *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetTextureSize", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "w", + "type": "float *" + }, + { + "name": "h", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTexturePalette", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetTexturePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureColorModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float" + } + ] + }, + { + "name": "SDL_GetTextureAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetTextureAlphaModFloat", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "alpha", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetTextureBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_UpdateTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "const void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateYUVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "Uplane", + "type": "const Uint8 *" + }, + { + "name": "Upitch", + "type": "int" + }, + { + "name": "Vplane", + "type": "const Uint8 *" + }, + { + "name": "Vpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_UpdateNVTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "Yplane", + "type": "const Uint8 *" + }, + { + "name": "Ypitch", + "type": "int" + }, + { + "name": "UVplane", + "type": "const Uint8 *" + }, + { + "name": "UVpitch", + "type": "int" + } + ] + }, + { + "name": "SDL_LockTexture", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "pixels", + "type": "void **" + }, + { + "name": "pitch", + "type": "int *" + } + ] + }, + { + "name": "SDL_LockTextureToSurface", + "return_type": "bool", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "surface", + "type": "SDL_Surface **" + } + ] + }, + { + "name": "SDL_UnlockTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_SetRenderTarget", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_GetRenderTarget", + "return_type": "SDL_Texture *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentation", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + }, + { + "name": "mode", + "type": "SDL_RendererLogicalPresentation *" + } + ] + }, + { + "name": "SDL_GetRenderLogicalPresentationRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesFromWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "window_x", + "type": "float" + }, + { + "name": "window_y", + "type": "float" + }, + { + "name": "x", + "type": "float *" + }, + { + "name": "y", + "type": "float *" + } + ] + }, + { + "name": "SDL_RenderCoordinatesToWindow", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "window_x", + "type": "float *" + }, + { + "name": "window_y", + "type": "float *" + } + ] + }, + { + "name": "SDL_ConvertEventToRenderCoordinates", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "event", + "type": "SDL_Event *" + } + ] + }, + { + "name": "SDL_SetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderViewport", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderViewportSet", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetRenderClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderClipEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_SetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float" + }, + { + "name": "scaleY", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scaleX", + "type": "float *" + }, + { + "name": "scaleY", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_SetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderDrawColor", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_GetRenderDrawColorFloat", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float" + } + ] + }, + { + "name": "SDL_GetRenderColorScale", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale", + "type": "float *" + } + ] + }, + { + "name": "SDL_SetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetRenderDrawBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_RenderClear", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_RenderPoint", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderPoints", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderLine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x1", + "type": "float" + }, + { + "name": "y1", + "type": "float" + }, + { + "name": "x2", + "type": "float" + }, + { + "name": "y2", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderLines", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "points", + "type": "const SDL_FPoint *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderFillRect", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderFillRects", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rects", + "type": "const SDL_FRect *" + }, + { + "name": "count", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderTexture", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTextureRotated", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "angle", + "type": "double" + }, + { + "name": "center", + "type": "const SDL_FPoint *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RenderTextureAffine", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "origin", + "type": "const SDL_FPoint *" + }, + { + "name": "right", + "type": "const SDL_FPoint *" + }, + { + "name": "down", + "type": "const SDL_FPoint *" + } + ] + }, + { + "name": "SDL_RenderTextureTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + } + ] + }, + { + "name": "SDL_RenderTexture9GridTiled", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "srcrect", + "type": "const SDL_FRect *" + }, + { + "name": "left_width", + "type": "float" + }, + { + "name": "right_width", + "type": "float" + }, + { + "name": "top_height", + "type": "float" + }, + { + "name": "bottom_height", + "type": "float" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "dstrect", + "type": "const SDL_FRect *" + }, + { + "name": "tileScale", + "type": "float" + } + ] + }, + { + "name": "SDL_RenderGeometry", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "vertices", + "type": "const SDL_Vertex *" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const int *" + }, + { + "name": "num_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_RenderGeometryRaw", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "texture", + "type": "SDL_Texture *" + }, + { + "name": "xy", + "type": "const float *" + }, + { + "name": "xy_stride", + "type": "int" + }, + { + "name": "color", + "type": "const SDL_FColor *" + }, + { + "name": "color_stride", + "type": "int" + }, + { + "name": "uv", + "type": "const float *" + }, + { + "name": "uv_stride", + "type": "int" + }, + { + "name": "num_vertices", + "type": "int" + }, + { + "name": "indices", + "type": "const void *" + }, + { + "name": "num_indices", + "type": "int" + }, + { + "name": "size_indices", + "type": "int" + } + ] + }, + { + "name": "SDL_SetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode" + } + ] + }, + { + "name": "SDL_GetRenderTextureAddressMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "u_mode", + "type": "SDL_TextureAddressMode *" + }, + { + "name": "v_mode", + "type": "SDL_TextureAddressMode *" + } + ] + }, + { + "name": "SDL_RenderReadPixels", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_RenderPresent", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_DestroyTexture", + "return_type": "void", + "parameters": [ + { + "name": "texture", + "type": "SDL_Texture *" + } + ] + }, + { + "name": "SDL_DestroyRenderer", + "return_type": "void", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_FlushRenderer", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalLayer", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_GetRenderMetalCommandEncoder", + "return_type": "void *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + } + ] + }, + { + "name": "SDL_AddVulkanRenderSemaphores", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "wait_stage_mask", + "type": "Uint32" + }, + { + "name": "wait_semaphore", + "type": "Sint64" + }, + { + "name": "signal_semaphore", + "type": "Sint64" + } + ] + }, + { + "name": "SDL_SetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetRenderVSync", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_RenderDebugText", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "x", + "type": "float" + }, + { + "name": "y", + "type": "float" + }, + { + "name": "str", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_GetDefaultTextureScaleMode", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "scale_mode", + "type": "SDL_ScaleMode *" + } + ] + }, + { + "name": "SDL_CreateGPURenderState", + "return_type": "SDL_GPURenderState *", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "createinfo", + "type": "const SDL_GPURenderStateCreateInfo *" + } + ] + }, + { + "name": "SDL_SetGPURenderStateFragmentUniforms", + "return_type": "bool", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + }, + { + "name": "slot_index", + "type": "Uint32" + }, + { + "name": "data", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SetGPURenderState", + "return_type": "bool", + "parameters": [ + { + "name": "renderer", + "type": "SDL_Renderer *" + }, + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + }, + { + "name": "SDL_DestroyGPURenderState", + "return_type": "void", + "parameters": [ + { + "name": "state", + "type": "SDL_GPURenderState *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/scancode.json b/official/release-3.4.8/json/scancode.json new file mode 100644 index 0000000..0b341a8 --- /dev/null +++ b/official/release-3.4.8/json/scancode.json @@ -0,0 +1,1083 @@ +{ + "header": "SDL_scancode.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_Scancode", + "values": [ + { + "name": "SDL_SCANCODE_UNKNOWN", + "value": "0" + }, + { + "name": "SDL_SCANCODE_A", + "value": "4" + }, + { + "name": "SDL_SCANCODE_B", + "value": "5" + }, + { + "name": "SDL_SCANCODE_C", + "value": "6" + }, + { + "name": "SDL_SCANCODE_D", + "value": "7" + }, + { + "name": "SDL_SCANCODE_E", + "value": "8" + }, + { + "name": "SDL_SCANCODE_F", + "value": "9" + }, + { + "name": "SDL_SCANCODE_G", + "value": "10" + }, + { + "name": "SDL_SCANCODE_H", + "value": "11" + }, + { + "name": "SDL_SCANCODE_I", + "value": "12" + }, + { + "name": "SDL_SCANCODE_J", + "value": "13" + }, + { + "name": "SDL_SCANCODE_K", + "value": "14" + }, + { + "name": "SDL_SCANCODE_L", + "value": "15" + }, + { + "name": "SDL_SCANCODE_M", + "value": "16" + }, + { + "name": "SDL_SCANCODE_N", + "value": "17" + }, + { + "name": "SDL_SCANCODE_O", + "value": "18" + }, + { + "name": "SDL_SCANCODE_P", + "value": "19" + }, + { + "name": "SDL_SCANCODE_Q", + "value": "20" + }, + { + "name": "SDL_SCANCODE_R", + "value": "21" + }, + { + "name": "SDL_SCANCODE_S", + "value": "22" + }, + { + "name": "SDL_SCANCODE_T", + "value": "23" + }, + { + "name": "SDL_SCANCODE_U", + "value": "24" + }, + { + "name": "SDL_SCANCODE_V", + "value": "25" + }, + { + "name": "SDL_SCANCODE_W", + "value": "26" + }, + { + "name": "SDL_SCANCODE_X", + "value": "27" + }, + { + "name": "SDL_SCANCODE_Y", + "value": "28" + }, + { + "name": "SDL_SCANCODE_Z", + "value": "29" + }, + { + "name": "SDL_SCANCODE_1", + "value": "30" + }, + { + "name": "SDL_SCANCODE_2", + "value": "31" + }, + { + "name": "SDL_SCANCODE_3", + "value": "32" + }, + { + "name": "SDL_SCANCODE_4", + "value": "33" + }, + { + "name": "SDL_SCANCODE_5", + "value": "34" + }, + { + "name": "SDL_SCANCODE_6", + "value": "35" + }, + { + "name": "SDL_SCANCODE_7", + "value": "36" + }, + { + "name": "SDL_SCANCODE_8", + "value": "37" + }, + { + "name": "SDL_SCANCODE_9", + "value": "38" + }, + { + "name": "SDL_SCANCODE_0", + "value": "39" + }, + { + "name": "SDL_SCANCODE_RETURN", + "value": "40" + }, + { + "name": "SDL_SCANCODE_ESCAPE", + "value": "41" + }, + { + "name": "SDL_SCANCODE_BACKSPACE", + "value": "42" + }, + { + "name": "SDL_SCANCODE_TAB", + "value": "43" + }, + { + "name": "SDL_SCANCODE_SPACE", + "value": "44" + }, + { + "name": "SDL_SCANCODE_MINUS", + "value": "45" + }, + { + "name": "SDL_SCANCODE_EQUALS", + "value": "46" + }, + { + "name": "SDL_SCANCODE_LEFTBRACKET", + "value": "47" + }, + { + "name": "SDL_SCANCODE_RIGHTBRACKET", + "value": "48" + }, + { + "name": "SDL_SCANCODE_BACKSLASH", + "value": "49", + "comment": "Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout." + }, + { + "name": "SDL_SCANCODE_NONUSHASH", + "value": "50", + "comment": "ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards." + }, + { + "name": "SDL_SCANCODE_SEMICOLON", + "value": "51" + }, + { + "name": "SDL_SCANCODE_APOSTROPHE", + "value": "52" + }, + { + "name": "SDL_SCANCODE_GRAVE", + "value": "53", + "comment": "Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards." + }, + { + "name": "SDL_SCANCODE_COMMA", + "value": "54" + }, + { + "name": "SDL_SCANCODE_PERIOD", + "value": "55" + }, + { + "name": "SDL_SCANCODE_SLASH", + "value": "56" + }, + { + "name": "SDL_SCANCODE_CAPSLOCK", + "value": "57" + }, + { + "name": "SDL_SCANCODE_F1", + "value": "58" + }, + { + "name": "SDL_SCANCODE_F2", + "value": "59" + }, + { + "name": "SDL_SCANCODE_F3", + "value": "60" + }, + { + "name": "SDL_SCANCODE_F4", + "value": "61" + }, + { + "name": "SDL_SCANCODE_F5", + "value": "62" + }, + { + "name": "SDL_SCANCODE_F6", + "value": "63" + }, + { + "name": "SDL_SCANCODE_F7", + "value": "64" + }, + { + "name": "SDL_SCANCODE_F8", + "value": "65" + }, + { + "name": "SDL_SCANCODE_F9", + "value": "66" + }, + { + "name": "SDL_SCANCODE_F10", + "value": "67" + }, + { + "name": "SDL_SCANCODE_F11", + "value": "68" + }, + { + "name": "SDL_SCANCODE_F12", + "value": "69" + }, + { + "name": "SDL_SCANCODE_PRINTSCREEN", + "value": "70" + }, + { + "name": "SDL_SCANCODE_SCROLLLOCK", + "value": "71" + }, + { + "name": "SDL_SCANCODE_PAUSE", + "value": "72" + }, + { + "name": "SDL_SCANCODE_INSERT", + "value": "73", + "comment": "insert on PC, help on some Mac keyboards (but does send code 73, not 117)" + }, + { + "name": "SDL_SCANCODE_HOME", + "value": "74" + }, + { + "name": "SDL_SCANCODE_PAGEUP", + "value": "75" + }, + { + "name": "SDL_SCANCODE_DELETE", + "value": "76" + }, + { + "name": "SDL_SCANCODE_END", + "value": "77" + }, + { + "name": "SDL_SCANCODE_PAGEDOWN", + "value": "78" + }, + { + "name": "SDL_SCANCODE_RIGHT", + "value": "79" + }, + { + "name": "SDL_SCANCODE_LEFT", + "value": "80" + }, + { + "name": "SDL_SCANCODE_DOWN", + "value": "81" + }, + { + "name": "SDL_SCANCODE_UP", + "value": "82" + }, + { + "name": "SDL_SCANCODE_NUMLOCKCLEAR", + "value": "83", + "comment": "num lock on PC, clear on Mac keyboards" + }, + { + "name": "SDL_SCANCODE_KP_DIVIDE", + "value": "84" + }, + { + "name": "SDL_SCANCODE_KP_MULTIPLY", + "value": "85" + }, + { + "name": "SDL_SCANCODE_KP_MINUS", + "value": "86" + }, + { + "name": "SDL_SCANCODE_KP_PLUS", + "value": "87" + }, + { + "name": "SDL_SCANCODE_KP_ENTER", + "value": "88" + }, + { + "name": "SDL_SCANCODE_KP_1", + "value": "89" + }, + { + "name": "SDL_SCANCODE_KP_2", + "value": "90" + }, + { + "name": "SDL_SCANCODE_KP_3", + "value": "91" + }, + { + "name": "SDL_SCANCODE_KP_4", + "value": "92" + }, + { + "name": "SDL_SCANCODE_KP_5", + "value": "93" + }, + { + "name": "SDL_SCANCODE_KP_6", + "value": "94" + }, + { + "name": "SDL_SCANCODE_KP_7", + "value": "95" + }, + { + "name": "SDL_SCANCODE_KP_8", + "value": "96" + }, + { + "name": "SDL_SCANCODE_KP_9", + "value": "97" + }, + { + "name": "SDL_SCANCODE_KP_0", + "value": "98" + }, + { + "name": "SDL_SCANCODE_KP_PERIOD", + "value": "99" + }, + { + "name": "SDL_SCANCODE_NONUSBACKSLASH", + "value": "100", + "comment": "This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout." + }, + { + "name": "SDL_SCANCODE_APPLICATION", + "value": "101", + "comment": "windows contextual menu, compose" + }, + { + "name": "SDL_SCANCODE_POWER", + "value": "102", + "comment": "The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key." + }, + { + "name": "SDL_SCANCODE_KP_EQUALS", + "value": "103" + }, + { + "name": "SDL_SCANCODE_F13", + "value": "104" + }, + { + "name": "SDL_SCANCODE_F14", + "value": "105" + }, + { + "name": "SDL_SCANCODE_F15", + "value": "106" + }, + { + "name": "SDL_SCANCODE_F16", + "value": "107" + }, + { + "name": "SDL_SCANCODE_F17", + "value": "108" + }, + { + "name": "SDL_SCANCODE_F18", + "value": "109" + }, + { + "name": "SDL_SCANCODE_F19", + "value": "110" + }, + { + "name": "SDL_SCANCODE_F20", + "value": "111" + }, + { + "name": "SDL_SCANCODE_F21", + "value": "112" + }, + { + "name": "SDL_SCANCODE_F22", + "value": "113" + }, + { + "name": "SDL_SCANCODE_F23", + "value": "114" + }, + { + "name": "SDL_SCANCODE_F24", + "value": "115" + }, + { + "name": "SDL_SCANCODE_EXECUTE", + "value": "116" + }, + { + "name": "SDL_SCANCODE_HELP", + "value": "117", + "comment": "AL Integrated Help Center" + }, + { + "name": "SDL_SCANCODE_MENU", + "value": "118", + "comment": "Menu (show menu)" + }, + { + "name": "SDL_SCANCODE_SELECT", + "value": "119" + }, + { + "name": "SDL_SCANCODE_STOP", + "value": "120", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AGAIN", + "value": "121", + "comment": "AC Redo/Repeat" + }, + { + "name": "SDL_SCANCODE_UNDO", + "value": "122", + "comment": "AC Undo" + }, + { + "name": "SDL_SCANCODE_CUT", + "value": "123", + "comment": "AC Cut" + }, + { + "name": "SDL_SCANCODE_COPY", + "value": "124", + "comment": "AC Copy" + }, + { + "name": "SDL_SCANCODE_PASTE", + "value": "125", + "comment": "AC Paste" + }, + { + "name": "SDL_SCANCODE_FIND", + "value": "126", + "comment": "AC Find" + }, + { + "name": "SDL_SCANCODE_MUTE", + "value": "127" + }, + { + "name": "SDL_SCANCODE_VOLUMEUP", + "value": "128" + }, + { + "name": "SDL_SCANCODE_VOLUMEDOWN", + "value": "129" + }, + { + "name": "SDL_SCANCODE_KP_COMMA", + "value": "133" + }, + { + "name": "SDL_SCANCODE_KP_EQUALSAS400", + "value": "134" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL1", + "value": "135", + "comment": "used on Asian keyboards, see footnotes in USB doc" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL2", + "value": "136" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL3", + "value": "137", + "comment": "Yen" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL4", + "value": "138" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL5", + "value": "139" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL6", + "value": "140" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL7", + "value": "141" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL8", + "value": "142" + }, + { + "name": "SDL_SCANCODE_INTERNATIONAL9", + "value": "143" + }, + { + "name": "SDL_SCANCODE_LANG1", + "value": "144", + "comment": "Hangul/English toggle" + }, + { + "name": "SDL_SCANCODE_LANG2", + "value": "145", + "comment": "Hanja conversion" + }, + { + "name": "SDL_SCANCODE_LANG3", + "value": "146", + "comment": "Katakana" + }, + { + "name": "SDL_SCANCODE_LANG4", + "value": "147", + "comment": "Hiragana" + }, + { + "name": "SDL_SCANCODE_LANG5", + "value": "148", + "comment": "Zenkaku/Hankaku" + }, + { + "name": "SDL_SCANCODE_LANG6", + "value": "149", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG7", + "value": "150", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG8", + "value": "151", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_LANG9", + "value": "152", + "comment": "reserved" + }, + { + "name": "SDL_SCANCODE_ALTERASE", + "value": "153", + "comment": "Erase-Eaze" + }, + { + "name": "SDL_SCANCODE_SYSREQ", + "value": "154" + }, + { + "name": "SDL_SCANCODE_CANCEL", + "value": "155", + "comment": "AC Cancel" + }, + { + "name": "SDL_SCANCODE_CLEAR", + "value": "156" + }, + { + "name": "SDL_SCANCODE_PRIOR", + "value": "157" + }, + { + "name": "SDL_SCANCODE_RETURN2", + "value": "158" + }, + { + "name": "SDL_SCANCODE_SEPARATOR", + "value": "159" + }, + { + "name": "SDL_SCANCODE_OUT", + "value": "160" + }, + { + "name": "SDL_SCANCODE_OPER", + "value": "161" + }, + { + "name": "SDL_SCANCODE_CLEARAGAIN", + "value": "162" + }, + { + "name": "SDL_SCANCODE_CRSEL", + "value": "163" + }, + { + "name": "SDL_SCANCODE_EXSEL", + "value": "164" + }, + { + "name": "SDL_SCANCODE_KP_00", + "value": "176" + }, + { + "name": "SDL_SCANCODE_KP_000", + "value": "177" + }, + { + "name": "SDL_SCANCODE_THOUSANDSSEPARATOR", + "value": "178" + }, + { + "name": "SDL_SCANCODE_DECIMALSEPARATOR", + "value": "179" + }, + { + "name": "SDL_SCANCODE_CURRENCYUNIT", + "value": "180" + }, + { + "name": "SDL_SCANCODE_CURRENCYSUBUNIT", + "value": "181" + }, + { + "name": "SDL_SCANCODE_KP_LEFTPAREN", + "value": "182" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTPAREN", + "value": "183" + }, + { + "name": "SDL_SCANCODE_KP_LEFTBRACE", + "value": "184" + }, + { + "name": "SDL_SCANCODE_KP_RIGHTBRACE", + "value": "185" + }, + { + "name": "SDL_SCANCODE_KP_TAB", + "value": "186" + }, + { + "name": "SDL_SCANCODE_KP_BACKSPACE", + "value": "187" + }, + { + "name": "SDL_SCANCODE_KP_A", + "value": "188" + }, + { + "name": "SDL_SCANCODE_KP_B", + "value": "189" + }, + { + "name": "SDL_SCANCODE_KP_C", + "value": "190" + }, + { + "name": "SDL_SCANCODE_KP_D", + "value": "191" + }, + { + "name": "SDL_SCANCODE_KP_E", + "value": "192" + }, + { + "name": "SDL_SCANCODE_KP_F", + "value": "193" + }, + { + "name": "SDL_SCANCODE_KP_XOR", + "value": "194" + }, + { + "name": "SDL_SCANCODE_KP_POWER", + "value": "195" + }, + { + "name": "SDL_SCANCODE_KP_PERCENT", + "value": "196" + }, + { + "name": "SDL_SCANCODE_KP_LESS", + "value": "197" + }, + { + "name": "SDL_SCANCODE_KP_GREATER", + "value": "198" + }, + { + "name": "SDL_SCANCODE_KP_AMPERSAND", + "value": "199" + }, + { + "name": "SDL_SCANCODE_KP_DBLAMPERSAND", + "value": "200" + }, + { + "name": "SDL_SCANCODE_KP_VERTICALBAR", + "value": "201" + }, + { + "name": "SDL_SCANCODE_KP_DBLVERTICALBAR", + "value": "202" + }, + { + "name": "SDL_SCANCODE_KP_COLON", + "value": "203" + }, + { + "name": "SDL_SCANCODE_KP_HASH", + "value": "204" + }, + { + "name": "SDL_SCANCODE_KP_SPACE", + "value": "205" + }, + { + "name": "SDL_SCANCODE_KP_AT", + "value": "206" + }, + { + "name": "SDL_SCANCODE_KP_EXCLAM", + "value": "207" + }, + { + "name": "SDL_SCANCODE_KP_MEMSTORE", + "value": "208" + }, + { + "name": "SDL_SCANCODE_KP_MEMRECALL", + "value": "209" + }, + { + "name": "SDL_SCANCODE_KP_MEMCLEAR", + "value": "210" + }, + { + "name": "SDL_SCANCODE_KP_MEMADD", + "value": "211" + }, + { + "name": "SDL_SCANCODE_KP_MEMSUBTRACT", + "value": "212" + }, + { + "name": "SDL_SCANCODE_KP_MEMMULTIPLY", + "value": "213" + }, + { + "name": "SDL_SCANCODE_KP_MEMDIVIDE", + "value": "214" + }, + { + "name": "SDL_SCANCODE_KP_PLUSMINUS", + "value": "215" + }, + { + "name": "SDL_SCANCODE_KP_CLEAR", + "value": "216" + }, + { + "name": "SDL_SCANCODE_KP_CLEARENTRY", + "value": "217" + }, + { + "name": "SDL_SCANCODE_KP_BINARY", + "value": "218" + }, + { + "name": "SDL_SCANCODE_KP_OCTAL", + "value": "219" + }, + { + "name": "SDL_SCANCODE_KP_DECIMAL", + "value": "220" + }, + { + "name": "SDL_SCANCODE_KP_HEXADECIMAL", + "value": "221" + }, + { + "name": "SDL_SCANCODE_LCTRL", + "value": "224" + }, + { + "name": "SDL_SCANCODE_LSHIFT", + "value": "225" + }, + { + "name": "SDL_SCANCODE_LALT", + "value": "226", + "comment": "alt, option" + }, + { + "name": "SDL_SCANCODE_LGUI", + "value": "227", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_RCTRL", + "value": "228" + }, + { + "name": "SDL_SCANCODE_RSHIFT", + "value": "229" + }, + { + "name": "SDL_SCANCODE_RALT", + "value": "230", + "comment": "alt gr, option" + }, + { + "name": "SDL_SCANCODE_RGUI", + "value": "231", + "comment": "windows, command (apple), meta" + }, + { + "name": "SDL_SCANCODE_MODE", + "value": "257", + "comment": "I'm not sure if this is really not covered by any of the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here" + }, + { + "name": "SDL_SCANCODE_SLEEP", + "value": "258", + "comment": "Sleep" + }, + { + "name": "SDL_SCANCODE_WAKE", + "value": "259", + "comment": "Wake" + }, + { + "name": "SDL_SCANCODE_CHANNEL_INCREMENT", + "value": "260", + "comment": "Channel Increment" + }, + { + "name": "SDL_SCANCODE_CHANNEL_DECREMENT", + "value": "261", + "comment": "Channel Decrement" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY", + "value": "262", + "comment": "Play" + }, + { + "name": "SDL_SCANCODE_MEDIA_PAUSE", + "value": "263", + "comment": "Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_RECORD", + "value": "264", + "comment": "Record" + }, + { + "name": "SDL_SCANCODE_MEDIA_FAST_FORWARD", + "value": "265", + "comment": "Fast Forward" + }, + { + "name": "SDL_SCANCODE_MEDIA_REWIND", + "value": "266", + "comment": "Rewind" + }, + { + "name": "SDL_SCANCODE_MEDIA_NEXT_TRACK", + "value": "267", + "comment": "Next Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_PREVIOUS_TRACK", + "value": "268", + "comment": "Previous Track" + }, + { + "name": "SDL_SCANCODE_MEDIA_STOP", + "value": "269", + "comment": "Stop" + }, + { + "name": "SDL_SCANCODE_MEDIA_EJECT", + "value": "270", + "comment": "Eject" + }, + { + "name": "SDL_SCANCODE_MEDIA_PLAY_PAUSE", + "value": "271", + "comment": "Play / Pause" + }, + { + "name": "SDL_SCANCODE_MEDIA_SELECT", + "value": "272" + }, + { + "name": "SDL_SCANCODE_AC_NEW", + "value": "273", + "comment": "AC New" + }, + { + "name": "SDL_SCANCODE_AC_OPEN", + "value": "274", + "comment": "AC Open" + }, + { + "name": "SDL_SCANCODE_AC_CLOSE", + "value": "275", + "comment": "AC Close" + }, + { + "name": "SDL_SCANCODE_AC_EXIT", + "value": "276", + "comment": "AC Exit" + }, + { + "name": "SDL_SCANCODE_AC_SAVE", + "value": "277", + "comment": "AC Save" + }, + { + "name": "SDL_SCANCODE_AC_PRINT", + "value": "278", + "comment": "AC Print" + }, + { + "name": "SDL_SCANCODE_AC_PROPERTIES", + "value": "279", + "comment": "AC Properties" + }, + { + "name": "SDL_SCANCODE_AC_SEARCH", + "value": "280", + "comment": "AC Search" + }, + { + "name": "SDL_SCANCODE_AC_HOME", + "value": "281", + "comment": "AC Home" + }, + { + "name": "SDL_SCANCODE_AC_BACK", + "value": "282", + "comment": "AC Back" + }, + { + "name": "SDL_SCANCODE_AC_FORWARD", + "value": "283", + "comment": "AC Forward" + }, + { + "name": "SDL_SCANCODE_AC_STOP", + "value": "284", + "comment": "AC Stop" + }, + { + "name": "SDL_SCANCODE_AC_REFRESH", + "value": "285", + "comment": "AC Refresh" + }, + { + "name": "SDL_SCANCODE_AC_BOOKMARKS", + "value": "286", + "comment": "AC Bookmarks" + }, + { + "name": "SDL_SCANCODE_SOFTLEFT", + "value": "287", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display." + }, + { + "name": "SDL_SCANCODE_SOFTRIGHT", + "value": "288", + "comment": "Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display." + }, + { + "name": "SDL_SCANCODE_CALL", + "value": "289", + "comment": "Used for accepting phone calls." + }, + { + "name": "SDL_SCANCODE_ENDCALL", + "value": "290", + "comment": "Used for rejecting phone calls." + }, + { + "name": "SDL_SCANCODE_RESERVED", + "value": "400", + "comment": "400-500 reserved for dynamic keycodes" + }, + { + "name": "SDL_SCANCODE_COUNT", + "value": "512", + "comment": "not a key, just marks the number of scancodes for array bounds" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/sensor.json b/official/release-3.4.8/json/sensor.json new file mode 100644 index 0000000..1ed79d6 --- /dev/null +++ b/official/release-3.4.8/json/sensor.json @@ -0,0 +1,207 @@ +{ + "header": "SDL_sensor.h", + "opaque_types": [ + { + "name": "SDL_Sensor" + } + ], + "typedefs": [ + { + "name": "SDL_SensorID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_SensorType", + "values": [ + { + "name": "SDL_SENSOR_INVALID", + "value": "-1", + "comment": "Returned for an invalid sensor" + }, + { + "name": "SDL_SENSOR_UNKNOWN", + "comment": "Unknown sensor type" + }, + { + "name": "SDL_SENSOR_ACCEL", + "comment": "Accelerometer" + }, + { + "name": "SDL_SENSOR_GYRO", + "comment": "Gyroscope" + }, + { + "name": "SDL_SENSOR_ACCEL_L", + "comment": "Accelerometer for left Joy-Con controller and Wii nunchuk" + }, + { + "name": "SDL_SENSOR_GYRO_L", + "comment": "Gyroscope for left Joy-Con controller" + }, + { + "name": "SDL_SENSOR_ACCEL_R", + "comment": "Accelerometer for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_GYRO_R", + "comment": "Gyroscope for right Joy-Con controller" + }, + { + "name": "SDL_SENSOR_COUNT" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetSensors", + "return_type": "SDL_SensorID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetSensorNameForID", + "return_type": "const char *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorTypeForID", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableTypeForID", + "return_type": "int", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_OpenSensor", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorFromID", + "return_type": "SDL_Sensor *", + "parameters": [ + { + "name": "instance_id", + "type": "SDL_SensorID" + } + ] + }, + { + "name": "SDL_GetSensorProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorName", + "return_type": "const char *", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorType", + "return_type": "SDL_SensorType", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorNonPortableType", + "return_type": "int", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorID", + "return_type": "SDL_SensorID", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_GetSensorData", + "return_type": "bool", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + }, + { + "name": "data", + "type": "float *" + }, + { + "name": "num_values", + "type": "int" + } + ] + }, + { + "name": "SDL_CloseSensor", + "return_type": "void", + "parameters": [ + { + "name": "sensor", + "type": "SDL_Sensor *" + } + ] + }, + { + "name": "SDL_UpdateSensors", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/storage.json b/official/release-3.4.8/json/storage.json new file mode 100644 index 0000000..96862aa --- /dev/null +++ b/official/release-3.4.8/json/storage.json @@ -0,0 +1,349 @@ +{ + "header": "SDL_storage.h", + "opaque_types": [ + { + "name": "SDL_Storage" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [ + { + "name": "SDL_StorageInterface", + "fields": [ + { + "name": "version", + "type": "Uint32" + }, + { + "name": "close", + "type": "bool (SDLCALL *close)(void *userdata)" + }, + { + "name": "ready", + "type": "bool (SDLCALL *ready)(void *userdata)" + }, + { + "name": "enumerate", + "type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)" + }, + { + "name": "info", + "type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)" + }, + { + "name": "read_file", + "type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)" + }, + { + "name": "write_file", + "type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)" + }, + { + "name": "mkdir", + "type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)" + }, + { + "name": "remove", + "type": "bool (SDLCALL *remove)(void *userdata, const char *path)" + }, + { + "name": "rename", + "type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "copy", + "type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)" + }, + { + "name": "space_remaining", + "type": "Uint64 (SDLCALL *space_remaining)(void *userdata)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_OpenTitleStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "override", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenUserStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "org", + "type": "const char *" + }, + { + "name": "app", + "type": "const char *" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_OpenFileStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_OpenStorage", + "return_type": "SDL_Storage *", + "parameters": [ + { + "name": "iface", + "type": "const SDL_StorageInterface *" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_CloseStorage", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_StorageReady", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GetStorageFileSize", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "length", + "type": "Uint64 *" + } + ] + }, + { + "name": "SDL_ReadStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "destination", + "type": "void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_WriteStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "source", + "type": "const void *" + }, + { + "name": "length", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_CreateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EnumerateStorageDirectory", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "callback", + "type": "SDL_EnumerateDirectoryCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_RenameStoragePath", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CopyStorageFile", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "oldpath", + "type": "const char *" + }, + { + "name": "newpath", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetStoragePathInfo", + "return_type": "bool", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "info", + "type": "SDL_PathInfo *" + } + ] + }, + { + "name": "SDL_GetStorageSpaceRemaining", + "return_type": "Uint64", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + } + ] + }, + { + "name": "SDL_GlobStorageDirectory", + "return_type": "char **", + "parameters": [ + { + "name": "storage", + "type": "SDL_Storage *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "pattern", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_GlobFlags" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/surface.json b/official/release-3.4.8/json/surface.json new file mode 100644 index 0000000..af6fa27 --- /dev/null +++ b/official/release-3.4.8/json/surface.json @@ -0,0 +1,1326 @@ +{ + "header": "SDL_surface.h", + "opaque_types": [ + { + "name": "SDL_Surface" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_ScaleMode", + "values": [ + { + "name": "SDL_SCALEMODE_INVALID", + "value": "-1" + }, + { + "name": "SDL_SCALEMODE_NEAREST", + "comment": "nearest pixel sampling" + }, + { + "name": "SDL_SCALEMODE_LINEAR", + "comment": "linear filtering" + }, + { + "name": "SDL_SCALEMODE_PIXELART", + "comment": "nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0" + } + ] + }, + { + "name": "SDL_FlipMode", + "values": [ + { + "name": "SDL_FLIP_NONE", + "comment": "Do not flip" + }, + { + "name": "SDL_FLIP_HORIZONTAL", + "comment": "flip horizontally" + }, + { + "name": "SDL_FLIP_VERTICAL", + "comment": "flip vertically" + }, + { + "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", + "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", + "comment": "flip horizontally and vertically (not a diagonal flip)" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_SurfaceFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_SURFACE_PREALLOCATED", + "value": "(1u << 0)", + "comment": "Surface uses preallocated pixel memory" + }, + { + "name": "SDL_SURFACE_LOCK_NEEDED", + "value": "(1u << 1)", + "comment": "Surface needs to be locked to access pixels" + }, + { + "name": "SDL_SURFACE_LOCKED", + "value": "(1u << 2)", + "comment": "Surface is currently locked" + }, + { + "name": "SDL_SURFACE_SIMD_ALIGNED", + "value": "(1u << 3)", + "comment": "Surface uses pixel memory allocated with SDL_aligned_alloc()" + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_CreateSurfaceFrom", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "pixels", + "type": "void *" + }, + { + "name": "pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroySurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + } + ] + }, + { + "name": "SDL_GetSurfaceColorspace", + "return_type": "SDL_Colorspace", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_CreateSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfacePalette", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "palette", + "type": "SDL_Palette *" + } + ] + }, + { + "name": "SDL_GetSurfacePalette", + "return_type": "SDL_Palette *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_AddSurfaceAlternateImage", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "image", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SurfaceHasAlternateImages", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceImages", + "return_type": "SDL_Surface **", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveSurfaceAlternateImages", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LockSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_UnlockSurface", + "return_type": "void", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_LoadSurface_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadBMP_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadBMP", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SaveBMP_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SaveBMP", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_LoadPNG_IO", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "src", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_LoadPNG", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SavePNG_IO", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "dst", + "type": "SDL_IOStream *" + }, + { + "name": "closeio", + "type": "bool" + } + ] + }, + { + "name": "SDL_SavePNG", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "file", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetSurfaceRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_SurfaceHasRLE", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "key", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_SurfaceHasColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_GetSurfaceColorKey", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "key", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_SetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceColorMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_GetSurfaceAlphaMod", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "alpha", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_SetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode" + } + ] + }, + { + "name": "SDL_GetSurfaceBlendMode", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "blendMode", + "type": "SDL_BlendMode *" + } + ] + }, + { + "name": "SDL_SetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetSurfaceClipRect", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_FlipSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "flip", + "type": "SDL_FlipMode" + } + ] + }, + { + "name": "SDL_RotateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "angle", + "type": "float" + } + ] + }, + { + "name": "SDL_DuplicateSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_ScaleSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_ConvertSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + } + ] + }, + { + "name": "SDL_ConvertSurfaceAndColorspace", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "format", + "type": "SDL_PixelFormat" + }, + { + "name": "palette", + "type": "SDL_Palette *" + }, + { + "name": "colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_ConvertPixels", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_ConvertPixelsAndColorspace", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "src_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst_colorspace", + "type": "SDL_Colorspace" + }, + { + "name": "dst_properties", + "type": "SDL_PropertiesID" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + } + ] + }, + { + "name": "SDL_PremultiplyAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "width", + "type": "int" + }, + { + "name": "height", + "type": "int" + }, + { + "name": "src_format", + "type": "SDL_PixelFormat" + }, + { + "name": "src", + "type": "const void *" + }, + { + "name": "src_pitch", + "type": "int" + }, + { + "name": "dst_format", + "type": "SDL_PixelFormat" + }, + { + "name": "dst", + "type": "void *" + }, + { + "name": "dst_pitch", + "type": "int" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_PremultiplySurfaceAlpha", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "linear", + "type": "bool" + } + ] + }, + { + "name": "SDL_ClearSurface", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + }, + { + "name": "SDL_FillSurfaceRect", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_FillSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "count", + "type": "int" + }, + { + "name": "color", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_BlitSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceUnchecked", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceUncheckedScaled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_StretchSurface", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiled", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurfaceTiledWithScale", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_BlitSurface9Grid", + "return_type": "bool", + "parameters": [ + { + "name": "src", + "type": "SDL_Surface *" + }, + { + "name": "srcrect", + "type": "const SDL_Rect *" + }, + { + "name": "left_width", + "type": "int" + }, + { + "name": "right_width", + "type": "int" + }, + { + "name": "top_height", + "type": "int" + }, + { + "name": "bottom_height", + "type": "int" + }, + { + "name": "scale", + "type": "float" + }, + { + "name": "scaleMode", + "type": "SDL_ScaleMode" + }, + { + "name": "dst", + "type": "SDL_Surface *" + }, + { + "name": "dstrect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_MapSurfaceRGB", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_MapSurfaceRGBA", + "return_type": "Uint32", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_ReadSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8 *" + }, + { + "name": "g", + "type": "Uint8 *" + }, + { + "name": "b", + "type": "Uint8 *" + }, + { + "name": "a", + "type": "Uint8 *" + } + ] + }, + { + "name": "SDL_ReadSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float *" + }, + { + "name": "g", + "type": "float *" + }, + { + "name": "b", + "type": "float *" + }, + { + "name": "a", + "type": "float *" + } + ] + }, + { + "name": "SDL_WriteSurfacePixel", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "Uint8" + }, + { + "name": "g", + "type": "Uint8" + }, + { + "name": "b", + "type": "Uint8" + }, + { + "name": "a", + "type": "Uint8" + } + ] + }, + { + "name": "SDL_WriteSurfacePixelFloat", + "return_type": "bool", + "parameters": [ + { + "name": "surface", + "type": "SDL_Surface *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + }, + { + "name": "r", + "type": "float" + }, + { + "name": "g", + "type": "float" + }, + { + "name": "b", + "type": "float" + }, + { + "name": "a", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/system.json b/official/release-3.4.8/json/system.json new file mode 100644 index 0000000..4201c5a --- /dev/null +++ b/official/release-3.4.8/json/system.json @@ -0,0 +1,359 @@ +{ + "header": "SDL_system.h", + "opaque_types": [ + { + "name": "MSG" + } + ], + "typedefs": [ + { + "name": "XTaskQueueHandle", + "underlying_type": "struct XTaskQueueObject *" + }, + { + "name": "XUserHandle", + "underlying_type": "struct XUser *" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_WindowsMessageHook" + }, + { + "name": "SDL_X11EventHook" + }, + { + "name": "SDL_iOSAnimationCallback" + }, + { + "name": "SDL_RequestAndroidPermissionCallback" + } + ], + "enums": [ + { + "name": "SDL_Sandbox", + "values": [ + { + "name": "SDL_SANDBOX_NONE", + "value": "0" + }, + { + "name": "SDL_SANDBOX_UNKNOWN_CONTAINER" + }, + { + "name": "SDL_SANDBOX_FLATPAK" + }, + { + "name": "SDL_SANDBOX_SNAP" + }, + { + "name": "SDL_SANDBOX_MACOS" + } + ] + } + ], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_SetWindowsMessageHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_WindowsMessageHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GetDirect3D9AdapterIndex", + "return_type": "int", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDXGIOutputInfo", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "adapterIndex", + "type": "int *" + }, + { + "name": "outputIndex", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetX11EventHook", + "return_type": "void", + "parameters": [ + { + "name": "callback", + "type": "SDL_X11EventHook" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriority", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "priority", + "type": "int" + } + ] + }, + { + "name": "SDL_SetLinuxThreadPriorityAndPolicy", + "return_type": "bool", + "parameters": [ + { + "name": "threadID", + "type": "Sint64" + }, + { + "name": "sdlPriority", + "type": "int" + }, + { + "name": "schedPolicy", + "type": "int" + } + ] + }, + { + "name": "SDL_SetiOSAnimationCallback", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "interval", + "type": "int" + }, + { + "name": "callback", + "type": "SDL_iOSAnimationCallback" + }, + { + "name": "callbackParam", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetiOSEventPump", + "return_type": "void", + "parameters": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetAndroidJNIEnv", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidActivity", + "return_type": "void *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidSDKVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_IsChromebook", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsDeXMode", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_SendAndroidBackButton", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetAndroidInternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStorageState", + "return_type": "Uint32", + "parameters": [] + }, + { + "name": "SDL_GetAndroidExternalStoragePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetAndroidCachePath", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_RequestAndroidPermission", + "return_type": "bool", + "parameters": [ + { + "name": "permission", + "type": "const char *" + }, + { + "name": "cb", + "type": "SDL_RequestAndroidPermissionCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ShowAndroidToast", + "return_type": "bool", + "parameters": [ + { + "name": "message", + "type": "const char *" + }, + { + "name": "duration", + "type": "int" + }, + { + "name": "gravity", + "type": "int" + }, + { + "name": "xoffset", + "type": "int" + }, + { + "name": "yoffset", + "type": "int" + } + ] + }, + { + "name": "SDL_SendAndroidMessage", + "return_type": "bool", + "parameters": [ + { + "name": "command", + "type": "Uint32" + }, + { + "name": "param", + "type": "int" + } + ] + }, + { + "name": "SDL_IsTablet", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_IsTV", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GetSandbox", + "return_type": "SDL_Sandbox", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillTerminate", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidReceiveMemoryWarning", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterBackground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationWillEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidEnterForeground", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_OnApplicationDidChangeStatusBarOrientation", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GetGDKTaskQueue", + "return_type": "bool", + "parameters": [ + { + "name": "outTaskQueue", + "type": "XTaskQueueHandle *" + } + ] + }, + { + "name": "SDL_GetGDKDefaultUser", + "return_type": "bool", + "parameters": [ + { + "name": "outUserHandle", + "type": "XUserHandle *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/time.json b/official/release-3.4.8/json/time.json new file mode 100644 index 0000000..cb14440 --- /dev/null +++ b/official/release-3.4.8/json/time.json @@ -0,0 +1,238 @@ +{ + "header": "SDL_time.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_DateFormat", + "values": [ + { + "name": "SDL_DATE_FORMAT_YYYYMMDD", + "value": "0", + "comment": "Year/Month/Day" + }, + { + "name": "SDL_DATE_FORMAT_DDMMYYYY", + "value": "1", + "comment": "Day/Month/Year" + }, + { + "name": "SDL_DATE_FORMAT_MMDDYYYY", + "value": "2", + "comment": "Month/Day/Year" + } + ] + }, + { + "name": "SDL_TimeFormat", + "values": [ + { + "name": "SDL_TIME_FORMAT_24HR", + "value": "0", + "comment": "24 hour time" + }, + { + "name": "SDL_TIME_FORMAT_12HR", + "value": "1", + "comment": "12 hour time" + } + ] + } + ], + "structs": [ + { + "name": "SDL_DateTime", + "fields": [ + { + "name": "year", + "type": "int", + "comment": "Year" + }, + { + "name": "month", + "type": "int", + "comment": "Month [01-12]" + }, + { + "name": "day", + "type": "int", + "comment": "Day of the month [01-31]" + }, + { + "name": "hour", + "type": "int", + "comment": "Hour [0-23]" + }, + { + "name": "minute", + "type": "int", + "comment": "Minute [0-59]" + }, + { + "name": "second", + "type": "int", + "comment": "Seconds [0-60]" + }, + { + "name": "nanosecond", + "type": "int", + "comment": "Nanoseconds [0-999999999]" + }, + { + "name": "day_of_week", + "type": "int", + "comment": "Day of the week [0-6] (0 being Sunday)" + }, + { + "name": "utc_offset", + "type": "int", + "comment": "Seconds east of UTC" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetDateTimeLocalePreferences", + "return_type": "bool", + "parameters": [ + { + "name": "dateFormat", + "type": "SDL_DateFormat *" + }, + { + "name": "timeFormat", + "type": "SDL_TimeFormat *" + } + ] + }, + { + "name": "SDL_GetCurrentTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToDateTime", + "return_type": "bool", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dt", + "type": "SDL_DateTime *" + }, + { + "name": "localTime", + "type": "bool" + } + ] + }, + { + "name": "SDL_DateTimeToTime", + "return_type": "bool", + "parameters": [ + { + "name": "dt", + "type": "const SDL_DateTime *" + }, + { + "name": "ticks", + "type": "SDL_Time *" + } + ] + }, + { + "name": "SDL_TimeToWindows", + "return_type": "void", + "parameters": [ + { + "name": "ticks", + "type": "SDL_Time" + }, + { + "name": "dwLowDateTime", + "type": "Uint32 *" + }, + { + "name": "dwHighDateTime", + "type": "Uint32 *" + } + ] + }, + { + "name": "SDL_TimeFromWindows", + "return_type": "SDL_Time", + "parameters": [ + { + "name": "dwLowDateTime", + "type": "Uint32" + }, + { + "name": "dwHighDateTime", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_GetDaysInMonth", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfYear", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + }, + { + "name": "SDL_GetDayOfWeek", + "return_type": "int", + "parameters": [ + { + "name": "year", + "type": "int" + }, + { + "name": "month", + "type": "int" + }, + { + "name": "day", + "type": "int" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/timer.json b/official/release-3.4.8/json/timer.json new file mode 100644 index 0000000..3d15345 --- /dev/null +++ b/official/release-3.4.8/json/timer.json @@ -0,0 +1,121 @@ +{ + "header": "SDL_timer.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TimerID", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TimerCallback" + }, + { + "name": "SDL_NSTimerCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTicks", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetTicksNS", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceCounter", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_GetPerformanceFrequency", + "return_type": "Uint64", + "parameters": [] + }, + { + "name": "SDL_Delay", + "return_type": "void", + "parameters": [ + { + "name": "ms", + "type": "Uint32" + } + ] + }, + { + "name": "SDL_DelayNS", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_DelayPrecise", + "return_type": "void", + "parameters": [ + { + "name": "ns", + "type": "Uint64" + } + ] + }, + { + "name": "SDL_AddTimer", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint32" + }, + { + "name": "callback", + "type": "SDL_TimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_AddTimerNS", + "return_type": "SDL_TimerID", + "parameters": [ + { + "name": "interval", + "type": "Uint64" + }, + { + "name": "callback", + "type": "SDL_NSTimerCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_RemoveTimer", + "return_type": "bool", + "parameters": [ + { + "name": "id", + "type": "SDL_TimerID" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/touch.json b/official/release-3.4.8/json/touch.json new file mode 100644 index 0000000..fc5caab --- /dev/null +++ b/official/release-3.4.8/json/touch.json @@ -0,0 +1,114 @@ +{ + "header": "SDL_touch.h", + "opaque_types": [], + "typedefs": [ + { + "name": "SDL_TouchID", + "underlying_type": "Uint64" + }, + { + "name": "SDL_FingerID", + "underlying_type": "Uint64" + } + ], + "function_pointers": [], + "c_type_aliases": [], + "enums": [ + { + "name": "SDL_TouchDeviceType", + "values": [ + { + "name": "SDL_TOUCH_DEVICE_INVALID", + "value": "-1" + }, + { + "name": "SDL_TOUCH_DEVICE_DIRECT", + "comment": "touch screen with window-relative coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE", + "comment": "trackpad with absolute device coordinates" + }, + { + "name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE", + "comment": "trackpad with screen cursor-relative coordinates" + } + ] + } + ], + "structs": [ + { + "name": "SDL_Finger", + "fields": [ + { + "name": "id", + "type": "SDL_FingerID", + "comment": "the finger ID" + }, + { + "name": "x", + "type": "float", + "comment": "the x-axis location of the touch event, normalized (0...1)" + }, + { + "name": "y", + "type": "float", + "comment": "the y-axis location of the touch event, normalized (0...1)" + }, + { + "name": "pressure", + "type": "float", + "comment": "the quantity of pressure applied, normalized (0...1)" + } + ] + } + ], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetTouchDevices", + "return_type": "SDL_TouchID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetTouchDeviceName", + "return_type": "const char *", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchDeviceType", + "return_type": "SDL_TouchDeviceType", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + } + ] + }, + { + "name": "SDL_GetTouchFingers", + "return_type": "SDL_Finger **", + "parameters": [ + { + "name": "touchID", + "type": "SDL_TouchID" + }, + { + "name": "count", + "type": "int *" + } + ] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/tray.json b/official/release-3.4.8/json/tray.json new file mode 100644 index 0000000..dd06018 --- /dev/null +++ b/official/release-3.4.8/json/tray.json @@ -0,0 +1,332 @@ +{ + "header": "SDL_tray.h", + "opaque_types": [ + { + "name": "SDL_Tray" + }, + { + "name": "SDL_TrayMenu" + }, + { + "name": "SDL_TrayEntry" + } + ], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_TrayCallback" + } + ], + "enums": [], + "structs": [], + "unions": [], + "flags": [ + { + "name": "SDL_TrayEntryFlags", + "underlying_type": "Uint32", + "values": [ + { + "name": "SDL_TRAYENTRY_BUTTON", + "value": "(1u << 0)", + "comment": "Make the entry a simple button. Required." + }, + { + "name": "SDL_TRAYENTRY_CHECKBOX", + "value": "(1u << 1)", + "comment": "Make the entry a checkbox. Required." + }, + { + "name": "SDL_TRAYENTRY_SUBMENU", + "value": "(1u << 2)", + "comment": "Prepare the entry to have a submenu. Required" + }, + { + "name": "SDL_TRAYENTRY_DISABLED", + "value": "(1u << 31)", + "comment": "Make the entry disabled. Optional." + }, + { + "name": "SDL_TRAYENTRY_CHECKED", + "value": "(1u << 30)", + "comment": "Make the entry checked. This is valid only for checkboxes. Optional." + } + ] + } + ], + "functions": [ + { + "name": "SDL_CreateTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "icon", + "type": "SDL_Surface *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_SetTrayIcon", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetTrayTooltip", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + }, + { + "name": "tooltip", + "type": "const char *" + } + ] + }, + { + "name": "SDL_CreateTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_CreateTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTraySubmenu", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayEntries", + "return_type": "const SDL_TrayEntry **", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_RemoveTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_InsertTrayEntryAt", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + }, + { + "name": "pos", + "type": "int" + }, + { + "name": "label", + "type": "const char *" + }, + { + "name": "flags", + "type": "SDL_TrayEntryFlags" + } + ] + }, + { + "name": "SDL_SetTrayEntryLabel", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "label", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetTrayEntryLabel", + "return_type": "const char *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryChecked", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "checked", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryChecked", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryEnabled", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetTrayEntryEnabled", + "return_type": "bool", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_SetTrayEntryCallback", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + }, + { + "name": "callback", + "type": "SDL_TrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_ClickTrayEntry", + "return_type": "void", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_DestroyTray", + "return_type": "void", + "parameters": [ + { + "name": "tray", + "type": "SDL_Tray *" + } + ] + }, + { + "name": "SDL_GetTrayEntryParent", + "return_type": "SDL_TrayMenu *", + "parameters": [ + { + "name": "entry", + "type": "SDL_TrayEntry *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentEntry", + "return_type": "SDL_TrayEntry *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_GetTrayMenuParentTray", + "return_type": "SDL_Tray *", + "parameters": [ + { + "name": "menu", + "type": "SDL_TrayMenu *" + } + ] + }, + { + "name": "SDL_UpdateTrays", + "return_type": "void", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/version.json b/official/release-3.4.8/json/version.json new file mode 100644 index 0000000..2b34fbd --- /dev/null +++ b/official/release-3.4.8/json/version.json @@ -0,0 +1,23 @@ +{ + "header": "SDL_version.h", + "opaque_types": [], + "typedefs": [], + "function_pointers": [], + "c_type_aliases": [], + "enums": [], + "structs": [], + "unions": [], + "flags": [], + "functions": [ + { + "name": "SDL_GetVersion", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetRevision", + "return_type": "const char *", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/official/release-3.4.8/json/video.json b/official/release-3.4.8/json/video.json new file mode 100644 index 0000000..cb4c11e --- /dev/null +++ b/official/release-3.4.8/json/video.json @@ -0,0 +1,1894 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + { + "name": "SDL_DisplayModeData" + }, + { + "name": "SDL_Window" + } + ], + "typedefs": [ + { + "name": "SDL_DisplayID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_WindowID", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContext", + "underlying_type": "struct SDL_GLContextState *" + }, + { + "name": "SDL_EGLDisplay", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLConfig", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLSurface", + "underlying_type": "void *" + }, + { + "name": "SDL_EGLAttrib", + "underlying_type": "intptr_t" + }, + { + "name": "SDL_EGLint", + "underlying_type": "int" + }, + { + "name": "SDL_GLProfile", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextReleaseFlag", + "underlying_type": "Uint32" + }, + { + "name": "SDL_GLContextResetNotification", + "underlying_type": "Uint32" + } + ], + "function_pointers": [], + "c_type_aliases": [ + { + "name": "SDL_EGLAttribArrayCallback" + }, + { + "name": "SDL_EGLIntArrayCallback" + }, + { + "name": "SDL_HitTest" + } + ], + "enums": [ + { + "name": "SDL_SystemTheme", + "values": [ + { + "name": "SDL_SYSTEM_THEME_UNKNOWN", + "comment": "Unknown system theme" + }, + { + "name": "SDL_SYSTEM_THEME_LIGHT", + "comment": "Light colored system theme" + }, + { + "name": "SDL_SYSTEM_THEME_DARK", + "comment": "Dark colored system theme" + } + ] + }, + { + "name": "SDL_DisplayOrientation", + "values": [ + { + "name": "SDL_ORIENTATION_UNKNOWN", + "comment": "The display orientation can't be determined" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE", + "comment": "The display is in landscape mode, with the right side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_LANDSCAPE_FLIPPED", + "comment": "The display is in landscape mode, with the left side up, relative to portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT", + "comment": "The display is in portrait mode" + }, + { + "name": "SDL_ORIENTATION_PORTRAIT_FLIPPED", + "comment": "The display is in portrait mode, upside down" + } + ] + }, + { + "name": "SDL_FlashOperation", + "values": [ + { + "name": "SDL_FLASH_CANCEL", + "comment": "Cancel any window flash state" + }, + { + "name": "SDL_FLASH_BRIEFLY", + "comment": "Flash the window briefly to get attention" + }, + { + "name": "SDL_FLASH_UNTIL_FOCUSED", + "comment": "Flash the window until it gets focus" + } + ] + }, + { + "name": "SDL_ProgressState", + "values": [ + { + "name": "SDL_PROGRESS_STATE_INVALID", + "value": "-1", + "comment": "An invalid progress state indicating an error; check SDL_GetError()" + }, + { + "name": "SDL_PROGRESS_STATE_NONE", + "comment": "No progress bar is shown" + }, + { + "name": "SDL_PROGRESS_STATE_INDETERMINATE", + "comment": "The progress bar is shown in a indeterminate state" + }, + { + "name": "SDL_PROGRESS_STATE_NORMAL", + "comment": "The progress bar is shown in a normal state" + }, + { + "name": "SDL_PROGRESS_STATE_PAUSED", + "comment": "The progress bar is shown in a paused state" + }, + { + "name": "SDL_PROGRESS_STATE_ERROR", + "comment": "The progress bar is shown in a state indicating the application had an error" + } + ] + }, + { + "name": "SDL_GLAttr", + "values": [ + { + "name": "SDL_GL_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + }, + { + "name": "SDL_GL_BUFFER_SIZE", + "comment": "the minimum number of bits for frame buffer size; defaults to 0." + }, + { + "name": "SDL_GL_DOUBLEBUFFER", + "comment": "whether the output is single or double buffered; defaults to double buffering on." + }, + { + "name": "SDL_GL_DEPTH_SIZE", + "comment": "the minimum number of bits in the depth buffer; defaults to 16." + }, + { + "name": "SDL_GL_STENCIL_SIZE", + "comment": "the minimum number of bits in the stencil buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_RED_SIZE", + "comment": "the minimum number of bits for the red channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_GREEN_SIZE", + "comment": "the minimum number of bits for the green channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_BLUE_SIZE", + "comment": "the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_ACCUM_ALPHA_SIZE", + "comment": "the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0." + }, + { + "name": "SDL_GL_STEREO", + "comment": "whether the output is stereo 3D; defaults to off." + }, + { + "name": "SDL_GL_MULTISAMPLEBUFFERS", + "comment": "the number of buffers used for multisample anti-aliasing; defaults to 0." + }, + { + "name": "SDL_GL_MULTISAMPLESAMPLES", + "comment": "the number of samples used around the current pixel used for multisample anti-aliasing." + }, + { + "name": "SDL_GL_ACCELERATED_VISUAL", + "comment": "set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either." + }, + { + "name": "SDL_GL_RETAINED_BACKING", + "comment": "not used (deprecated)." + }, + { + "name": "SDL_GL_CONTEXT_MAJOR_VERSION", + "comment": "OpenGL context major version." + }, + { + "name": "SDL_GL_CONTEXT_MINOR_VERSION", + "comment": "OpenGL context minor version." + }, + { + "name": "SDL_GL_CONTEXT_FLAGS", + "comment": "some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0." + }, + { + "name": "SDL_GL_CONTEXT_PROFILE_MASK", + "comment": "type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform." + }, + { + "name": "SDL_GL_SHARE_WITH_CURRENT_CONTEXT", + "comment": "OpenGL context sharing; defaults to 0." + }, + { + "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", + "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + }, + { + "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", + "comment": "sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH." + }, + { + "name": "SDL_GL_CONTEXT_RESET_NOTIFICATION", + "comment": "set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION." + }, + { + "name": "SDL_GL_CONTEXT_NO_ERROR" + }, + { + "name": "SDL_GL_FLOATBUFFERS" + }, + { + "name": "SDL_GL_EGL_PLATFORM" + } + ] + }, + { + "name": "SDL_HitTestResult", + "values": [ + { + "name": "SDL_HITTEST_NORMAL", + "comment": "Region is normal. No special properties." + }, + { + "name": "SDL_HITTEST_DRAGGABLE", + "comment": "Region can drag entire window." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPLEFT", + "comment": "Region is the resizable top-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOP", + "comment": "Region is the resizable top border." + }, + { + "name": "SDL_HITTEST_RESIZE_TOPRIGHT", + "comment": "Region is the resizable top-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_RIGHT", + "comment": "Region is the resizable right border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMRIGHT", + "comment": "Region is the resizable bottom-right corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOM", + "comment": "Region is the resizable bottom border." + }, + { + "name": "SDL_HITTEST_RESIZE_BOTTOMLEFT", + "comment": "Region is the resizable bottom-left corner border." + }, + { + "name": "SDL_HITTEST_RESIZE_LEFT", + "comment": "Region is the resizable left border." + } + ] + } + ], + "structs": [ + { + "name": "SDL_DisplayMode", + "fields": [ + { + "name": "displayID", + "type": "SDL_DisplayID", + "comment": "the display this mode is associated with" + }, + { + "name": "format", + "type": "SDL_PixelFormat", + "comment": "pixel format" + }, + { + "name": "w", + "type": "int", + "comment": "width" + }, + { + "name": "h", + "type": "int", + "comment": "height" + }, + { + "name": "pixel_density", + "type": "float", + "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)" + }, + { + "name": "refresh_rate", + "type": "float", + "comment": "refresh rate (or 0.0f for unspecified)" + }, + { + "name": "refresh_rate_numerator", + "type": "int", + "comment": "precise refresh rate numerator (or 0 for unspecified)" + }, + { + "name": "refresh_rate_denominator", + "type": "int", + "comment": "precise refresh rate denominator" + }, + { + "name": "internal", + "type": "SDL_DisplayModeData *", + "comment": "Private" + } + ] + } + ], + "unions": [], + "flags": [ + { + "name": "SDL_WindowFlags", + "underlying_type": "Uint64", + "values": [ + { + "name": "SDL_WINDOW_FULLSCREEN", + "value": "(1u << 0)", + "comment": "window is in fullscreen mode" + }, + { + "name": "SDL_WINDOW_OPENGL", + "value": "(1u << 1)", + "comment": "window usable with OpenGL context" + }, + { + "name": "SDL_WINDOW_OCCLUDED", + "value": "(1u << 2)", + "comment": "window is occluded" + }, + { + "name": "SDL_WINDOW_HIDDEN", + "value": "(1u << 3)", + "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible" + }, + { + "name": "SDL_WINDOW_BORDERLESS", + "value": "(1u << 4)", + "comment": "no window decoration" + }, + { + "name": "SDL_WINDOW_RESIZABLE", + "value": "(1u << 5)", + "comment": "window can be resized" + }, + { + "name": "SDL_WINDOW_MINIMIZED", + "value": "(1u << 6)", + "comment": "window is minimized" + }, + { + "name": "SDL_WINDOW_MAXIMIZED", + "value": "(1u << 7)", + "comment": "window is maximized" + }, + { + "name": "SDL_WINDOW_MOUSE_GRABBED", + "value": "(1u << 8)", + "comment": "window has grabbed mouse input" + }, + { + "name": "SDL_WINDOW_INPUT_FOCUS", + "value": "(1u << 9)", + "comment": "window has input focus" + }, + { + "name": "SDL_WINDOW_MOUSE_FOCUS", + "value": "(1u << 10)", + "comment": "window has mouse focus" + }, + { + "name": "SDL_WINDOW_EXTERNAL", + "value": "(1u << 11)", + "comment": "window not created by SDL" + }, + { + "name": "SDL_WINDOW_MODAL", + "value": "(1u << 12)", + "comment": "window is modal" + }, + { + "name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", + "value": "(1u << 13)", + "comment": "window uses high pixel density back buffer if possible" + }, + { + "name": "SDL_WINDOW_MOUSE_CAPTURE", + "value": "(1u << 14)", + "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)" + }, + { + "name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", + "value": "(1u << 15)", + "comment": "window has relative mode enabled" + }, + { + "name": "SDL_WINDOW_ALWAYS_ON_TOP", + "value": "(1u << 16)", + "comment": "window should always be above others" + }, + { + "name": "SDL_WINDOW_UTILITY", + "value": "(1u << 17)", + "comment": "window should be treated as a utility window, not showing in the task bar and window list" + }, + { + "name": "SDL_WINDOW_TOOLTIP", + "value": "(1u << 18)", + "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window" + }, + { + "name": "SDL_WINDOW_POPUP_MENU", + "value": "(1u << 19)", + "comment": "window should be treated as a popup menu, requires a parent window" + }, + { + "name": "SDL_WINDOW_KEYBOARD_GRABBED", + "value": "(1u << 20)", + "comment": "window has grabbed keyboard input" + }, + { + "name": "SDL_WINDOW_FILL_DOCUMENT", + "value": "(1u << 21)", + "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" + }, + { + "name": "SDL_WINDOW_VULKAN", + "value": "(1u << 28)", + "comment": "window usable for Vulkan surface" + }, + { + "name": "SDL_WINDOW_METAL", + "value": "(1u << 29)", + "comment": "window usable for Metal view" + }, + { + "name": "SDL_WINDOW_TRANSPARENT", + "value": "(1u << 30)", + "comment": "window with transparent buffer" + }, + { + "name": "SDL_WINDOW_NOT_FOCUSABLE", + "value": "(1u << 31)", + "comment": "window should not be focusable" + } + ] + } + ], + "functions": [ + { + "name": "SDL_GetNumVideoDrivers", + "return_type": "int", + "parameters": [] + }, + { + "name": "SDL_GetVideoDriver", + "return_type": "const char *", + "parameters": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "SDL_GetCurrentVideoDriver", + "return_type": "const char *", + "parameters": [] + }, + { + "name": "SDL_GetSystemTheme", + "return_type": "SDL_SystemTheme", + "parameters": [] + }, + { + "name": "SDL_GetDisplays", + "return_type": "SDL_DisplayID *", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetPrimaryDisplay", + "return_type": "SDL_DisplayID", + "parameters": [] + }, + { + "name": "SDL_GetDisplayProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayName", + "return_type": "const char *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayUsableBounds", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetNaturalDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayOrientation", + "return_type": "SDL_DisplayOrientation", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayContentScale", + "return_type": "float", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetFullscreenDisplayModes", + "return_type": "SDL_DisplayMode **", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetClosestFullscreenDisplayMode", + "return_type": "bool", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "refresh_rate", + "type": "float" + }, + { + "name": "include_high_density_modes", + "type": "bool" + }, + { + "name": "closest", + "type": "SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetDesktopDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetCurrentDisplayMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "displayID", + "type": "SDL_DisplayID" + } + ] + }, + { + "name": "SDL_GetDisplayForPoint", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "point", + "type": "const SDL_Point *" + } + ] + }, + { + "name": "SDL_GetDisplayForRect", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetDisplayForWindow", + "return_type": "SDL_DisplayID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowPixelDensity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowDisplayScale", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreenMode", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "mode", + "type": "const SDL_DisplayMode *" + } + ] + }, + { + "name": "SDL_GetWindowFullscreenMode", + "return_type": "const SDL_DisplayMode *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowICCProfile", + "return_type": "void *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "size", + "type": "size_t *" + } + ] + }, + { + "name": "SDL_GetWindowPixelFormat", + "return_type": "SDL_PixelFormat", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindows", + "return_type": "SDL_Window **", + "parameters": [ + { + "name": "count", + "type": "int *" + } + ] + }, + { + "name": "SDL_CreateWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "title", + "type": "const char *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreatePopupWindow", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "parent", + "type": "SDL_Window *" + }, + { + "name": "offset_x", + "type": "int" + }, + { + "name": "offset_y", + "type": "int" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + }, + { + "name": "flags", + "type": "SDL_WindowFlags" + } + ] + }, + { + "name": "SDL_CreateWindowWithProperties", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "props", + "type": "SDL_PropertiesID" + } + ] + }, + { + "name": "SDL_GetWindowID", + "return_type": "SDL_WindowID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFromID", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "id", + "type": "SDL_WindowID" + } + ] + }, + { + "name": "SDL_GetWindowParent", + "return_type": "SDL_Window *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowProperties", + "return_type": "SDL_PropertiesID", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowFlags", + "return_type": "SDL_WindowFlags", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowTitle", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "title", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GetWindowTitle", + "return_type": "const char *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowIcon", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "icon", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_SetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowPosition", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int *" + }, + { + "name": "y", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int" + }, + { + "name": "h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSafeArea", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "SDL_Rect *" + } + ] + }, + { + "name": "SDL_SetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float" + }, + { + "name": "max_aspect", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowAspectRatio", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_aspect", + "type": "float *" + }, + { + "name": "max_aspect", + "type": "float *" + } + ] + }, + { + "name": "SDL_GetWindowBordersSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "top", + "type": "int *" + }, + { + "name": "left", + "type": "int *" + }, + { + "name": "bottom", + "type": "int *" + }, + { + "name": "right", + "type": "int *" + } + ] + }, + { + "name": "SDL_GetWindowSizeInPixels", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "min_w", + "type": "int" + }, + { + "name": "min_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMinimumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "max_w", + "type": "int" + }, + { + "name": "max_h", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowMaximumSize", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "w", + "type": "int *" + }, + { + "name": "h", + "type": "int *" + } + ] + }, + { + "name": "SDL_SetWindowBordered", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "bordered", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowResizable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "resizable", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowAlwaysOnTop", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "on_top", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFillDocument", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fill", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_HideWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RaiseWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MaximizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_MinimizeWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_RestoreWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowFullscreen", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "fullscreen", + "type": "bool" + } + ] + }, + { + "name": "SDL_SyncWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_WindowHasSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowSurface", + "return_type": "SDL_Surface *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int" + } + ] + }, + { + "name": "SDL_GetWindowSurfaceVSync", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "vsync", + "type": "int *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_UpdateWindowSurfaceRects", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rects", + "type": "const SDL_Rect *" + }, + { + "name": "numrects", + "type": "int" + } + ] + }, + { + "name": "SDL_DestroyWindowSurface", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "grabbed", + "type": "bool" + } + ] + }, + { + "name": "SDL_GetWindowKeyboardGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetWindowMouseGrab", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GetGrabbedWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_SetWindowMouseRect", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "rect", + "type": "const SDL_Rect *" + } + ] + }, + { + "name": "SDL_GetWindowMouseRect", + "return_type": "const SDL_Rect *", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowOpacity", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "opacity", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowOpacity", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowParent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "parent", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowModal", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "modal", + "type": "bool" + } + ] + }, + { + "name": "SDL_SetWindowFocusable", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "focusable", + "type": "bool" + } + ] + }, + { + "name": "SDL_ShowWindowSystemMenu", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "x", + "type": "int" + }, + { + "name": "y", + "type": "int" + } + ] + }, + { + "name": "SDL_SetWindowHitTest", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "callback", + "type": "SDL_HitTest" + }, + { + "name": "callback_data", + "type": "void *" + } + ] + }, + { + "name": "SDL_SetWindowShape", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "shape", + "type": "SDL_Surface *" + } + ] + }, + { + "name": "SDL_FlashWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "operation", + "type": "SDL_FlashOperation" + } + ] + }, + { + "name": "SDL_SetWindowProgressState", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "state", + "type": "SDL_ProgressState" + } + ] + }, + { + "name": "SDL_GetWindowProgressState", + "return_type": "SDL_ProgressState", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_SetWindowProgressValue", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "value", + "type": "float" + } + ] + }, + { + "name": "SDL_GetWindowProgressValue", + "return_type": "float", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_DestroyWindow", + "return_type": "void", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_ScreenSaverEnabled", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_EnableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_DisableScreenSaver", + "return_type": "bool", + "parameters": [] + }, + { + "name": "SDL_GL_LoadLibrary", + "return_type": "bool", + "parameters": [ + { + "name": "path", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_EGL_GetProcAddress", + "return_type": "SDL_FunctionPointer", + "parameters": [ + { + "name": "proc", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_UnloadLibrary", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_ExtensionSupported", + "return_type": "bool", + "parameters": [ + { + "name": "extension", + "type": "const char *" + } + ] + }, + { + "name": "SDL_GL_ResetAttributes", + "return_type": "void", + "parameters": [] + }, + { + "name": "SDL_GL_SetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetAttribute", + "return_type": "bool", + "parameters": [ + { + "name": "attr", + "type": "SDL_GLAttr" + }, + { + "name": "value", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_CreateContext", + "return_type": "SDL_GLContext", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_MakeCurrent", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + }, + { + "name": "context", + "type": "SDL_GLContext" + } + ] + }, + { + "name": "SDL_GL_GetCurrentWindow", + "return_type": "SDL_Window *", + "parameters": [] + }, + { + "name": "SDL_GL_GetCurrentContext", + "return_type": "SDL_GLContext", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentDisplay", + "return_type": "SDL_EGLDisplay", + "parameters": [] + }, + { + "name": "SDL_EGL_GetCurrentConfig", + "return_type": "SDL_EGLConfig", + "parameters": [] + }, + { + "name": "SDL_EGL_GetWindowSurface", + "return_type": "SDL_EGLSurface", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_EGL_SetAttributeCallbacks", + "return_type": "void", + "parameters": [ + { + "name": "platformAttribCallback", + "type": "SDL_EGLAttribArrayCallback" + }, + { + "name": "surfaceAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "contextAttribCallback", + "type": "SDL_EGLIntArrayCallback" + }, + { + "name": "userdata", + "type": "void *" + } + ] + }, + { + "name": "SDL_GL_SetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int" + } + ] + }, + { + "name": "SDL_GL_GetSwapInterval", + "return_type": "bool", + "parameters": [ + { + "name": "interval", + "type": "int *" + } + ] + }, + { + "name": "SDL_GL_SwapWindow", + "return_type": "bool", + "parameters": [ + { + "name": "window", + "type": "SDL_Window *" + } + ] + }, + { + "name": "SDL_GL_DestroyContext", + "return_type": "bool", + "parameters": [ + { + "name": "context", + "type": "SDL_GLContext" + } + ] + } + ] +} \ No newline at end of file -- 2.40.1